Created
October 26, 2022 23:43
-
-
Save phette23/5ea0781097e59a0a8555f844e613f05c to your computer and use it in GitHub Desktop.
add ECL-2.0 license to current repo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env fish | |
if ! git status 2&>/dev/null | |
echo "Must be run inside a git repo, run 'git init' first if need be" >&2 | |
exit 1 | |
end | |
begin | |
if ! test -f LICENSE.txt | |
echo "Downloading license text" | |
wget https://raw.githubusercontent.com/cca/koha_snippets/main/LICENSE.txt | |
end | |
if ! grep '## LICENSE' readme.md 2&>/dev/null | |
echo -e "\nEditing readme" | |
echo "\ | |
## LICENSE | |
[ECL Version 2.0](https://opensource.org/licenses/ECL-2.0)" >>readme.md | |
end | |
if test -f package.json | |
echo -e "\nEditing package.json" | |
sed -i '' 's/"license": ".*"/"license": "ECL-2.0"/' package.json | |
end | |
end | |
and echo 'Applied ECL-2.0 license to project' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment