add --create and --ifexists options to line #342

Open
stephan wants to merge 2 commits from stephan/cdist:line_create_ifexists into master
Contributor

Add the options create to create the file if it does not exist and ifexists to skip the modification if the file does not exist.

Add the options create to create the file if it does not exist and ifexists to skip the modification if the file does not exist.
stephan added 1 commit 2022-07-29 20:48:32 +00:00
Owner

Hey @stephan ! How is --create different from the exact same version of the file type? I.e. what do we gain by adding this?

Hey @stephan ! How is --create different from the exact same version of the file type? I.e. what do we gain by adding this?
Owner

In regards to ifexists, I understand that there might be a use case (would be great if you can add this one to the documenntation part), but I find the naming a bit tricky:

  • ifexists might imply that "only do things if the file exists", which is the default
  • ifexists might refer to an existing line

I was first inclined to name it "only-if-file-exists", but that actually does not describe the situation. The introduced behaviour is:

  • Ignore the line if the file does not exist

So the most reasonable parameter that comes to my mind would be: ignore-if-file-does-not-exist, which we might want to shrink down a little bit.

Open for suggestions, but I don't think ifexists is the final one.

In regards to `ifexists`, I understand that there might be a use case (would be great if you can add this one to the documenntation part), but I find the naming a bit tricky: * ifexists might imply that "only do things if the file exists", which is the default * ifexists might refer to an existing line I was first inclined to name it "only-if-file-exists", but that actually does not describe the situation. The introduced behaviour is: * Ignore the line if the file does not exist So the most reasonable parameter that comes to my mind would be: `ignore-if-file-does-not-exist`, which we might want to shrink down a little bit. Open for suggestions, but I don't think `ifexists` is the final one.
stephan added 1 commit 2022-07-31 17:30:49 +00:00
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
You can also view command line instructions.

Step 1:

From your project repository, check out a new branch and test the changes.
git checkout -b stephan-line_create_ifexists master
git pull line_create_ifexists

Step 2:

Merge the changes and update on Gitea.
git checkout master
git merge --no-ff stephan-line_create_ifexists
git push origin master
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: ungleich-public/cdist#342
No description provided.