Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bulk update files #4

Open
mbrukman opened this issue Sep 12, 2016 · 1 comment
Open

Bulk update files #4

mbrukman opened this issue Sep 12, 2016 · 1 comment

Comments

@mbrukman
Copy link
Owner

It would be nice to have a utility to bulk-update all files of a particular type or language and insert a comment at the top of the file.

Proposed feature evolution:

  • v1: prepend given license to all files that match a filter or just in a list
  • v2: detect whether or not a license header already exists and avoid modifying that file
mbrukman added a commit that referenced this issue Sep 13, 2016
Adds `-i` flag to modify the filename provided as an argument, rather than
outputting the license comment to stdout.

Added basic tests for in-place file modification.

This partially implements issue #4.
@mbrukman
Copy link
Owner Author

mbrukman commented Nov 5, 2016

Given the in-place file modification was implemented, files can now be updated in bulk via:

find . -type f -name \*.sh -exec /path/to/autogen -i [options...] {} \;

So the v1 feature can be considered implemented. However, the tool will still prepend a license even if a license header already exists, so this operation is not idempotent as requested for v2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant