Skip to content

Add new file_line option append_on_no_match#717

Merged
eputnam merged 1 commit intopuppetlabs:masterfrom
ripclawffb:filelineoption
Jul 26, 2017
Merged

Add new file_line option append_on_no_match#717
eputnam merged 1 commit intopuppetlabs:masterfrom
ripclawffb:filelineoption

Conversation

@ripclawffb
Copy link
Copy Markdown
Contributor

Currently, there doesn't exist a way to leave a file untouched if no regex matches are found.

I have a use case where I'm searching for a specific regex in multiple files and I only want to update the files that contain the regex pattern.

@tphoney
Copy link
Copy Markdown
Contributor

tphoney commented Jul 7, 2017

@ripclawffb There have been a number of changes in the file_line can you see if this PR is still necessary.

More importantly apologies for the slowness to getting to this PR

@ripclawffb
Copy link
Copy Markdown
Contributor Author

@tphoney I reviewed the changes for file_line and there still doesn't seem to be an option to not add a line if a match is not found in a file.

I also went ahead and rebased as requested.

@eputnam
Copy link
Copy Markdown
Contributor

eputnam commented Jul 18, 2017

rebased again @tphoney, looks ok pending travis. @ripclawffb take a look if you'd like to make sure it still looks ok to you.

@ripclawffb
Copy link
Copy Markdown
Contributor Author

@eputnam thanks! looks good to me.

@eputnam eputnam merged commit d65a144 into puppetlabs:master Jul 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants