Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fwolf/copyright-year-updater.sh
Automatic update year in copyright notice
https://github.com/fwolf/copyright-year-updater.sh
copyright git hooks shell year
Last synced: about 7 hours ago
JSON representation
Automatic update year in copyright notice
- Host: GitHub
- URL: https://github.com/fwolf/copyright-year-updater.sh
- Owner: fwolf
- License: other
- Created: 2015-03-13T09:50:50.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2021-09-27T15:38:31.000Z (about 3 years ago)
- Last Synced: 2023-03-11T04:13:18.419Z (over 1 year ago)
- Topics: copyright, git, hooks, shell, year
- Language: Shell
- Homepage:
- Size: 22.5 KB
- Stars: 9
- Watchers: 2
- Forks: 8
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# Copyright Year Updater
[![Build Status](https://travis-ci.org/fwolf/copyright-year-updater.sh.svg?branch=master)](https://travis-ci.org/fwolf/copyright-year-updater.sh)
Automatic update year in copyright notice, follow
[GNU Suggestion](https://www.gnu.org/licenses/gpl-howto.html).## Usage
copyright-year-updater.sh [Options] [File]
### Options
-y, --year Copyright end year, default is current year
All options must set before `[File]`.
### Multiple files
Currently can only update single file, but we can use `find` and `xargs` to
treat multiple files:find *.sh | xargs -L1 copyright-year-updater.sh
## Git pre-commit hook
Copy `pre-commit.sample.sh` as `.git/hooks/pre-commit`, chmod +x.
This hook will not touch un-staged file, even this file have staged part.
## Notice for usage in MacOS X
MacOS X uses BSD version command utils, so you need GNU versons:
- Bash v4
- grep
- sed
- xargsYou can install them via brew and configure to use them, here is some useful
links:- http://superuser.com/a/1038813/190139
- https://gist.github.com/samnang/1759336
- http://apple.stackexchange.com/a/193300
- http://stackoverflow.com/questions/30003570/how-to-use-gnu-sed-on-mac-os-x
- https://sagebionetworks.jira.com/wiki/display/PLFM/Fixing+sed+on+OSx
- https://twitter.com/fwolf/status/780103797745987584Brew by default install `grep`, `sed`, `xargs` with prefixed with `g`, like
`ggrep`, to overwrite system grep:- In `/usr/local/bin/`, ln `ggrep` to `grep`, so do `gsed` and `xargs`
- Config PATH, put `/usr/local/bin/` before `/usr/bin/` or `$PATH`
- Restart bash## License
MIT