Skip to content

Instantly share code, notes, and snippets.

@phette23
Created October 26, 2022 23:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phette23/5ea0781097e59a0a8555f844e613f05c to your computer and use it in GitHub Desktop.
Save phette23/5ea0781097e59a0a8555f844e613f05c to your computer and use it in GitHub Desktop.
add ECL-2.0 license to current repo
#!/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