Skip to content

Instantly share code, notes, and snippets.

@sevennt
Created August 20, 2018 03:29
Show Gist options
  • Select an option

  • Save sevennt/2f62a31111f83cb887ded2f29066556d to your computer and use it in GitHub Desktop.

Select an option

Save sevennt/2f62a31111f83cb887ded2f29066556d to your computer and use it in GitHub Desktop.
add LICENSE description to file header
#!/bin/bash
# ./license.sh src/api
# ./license.sh src/ui/src
if [[ $1 -eq "" ]]; then
echo "empty schema"
exit 1
fi
echo $1
find $1 -regex ".*\.\(go\|js\|scss\)" -print0 | while IFS= read -r -d '' file
do
if [[ -f $file ]]; then
echo "$file"
cat license-header $file > $file.new
mv $file.new $file
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment