diff --git a/scripts/file_license_check.sh b/scripts/file_license_check.sh index 58e2b264bb..b65be5509c 100755 --- a/scripts/file_license_check.sh +++ b/scripts/file_license_check.sh @@ -1,11 +1,14 @@ #!/bin/bash -# run from the repo root +# Must be run from the repo root rg -i "Copyright.*The Tari Project" --files-without-match \ -g '!*.{Dockerfile,asc,bat,config,config.js,css,csv,drawio,gitkeep,hbs,html,iss,json,lock,md,min.js,ps1,py,rc,scss,sh,sql,svg,toml,txt,yml,vue}' . \ - | sort >/tmp/rgtemp + | sort > /tmp/rgtemp -DIFFS=$(diff -u .license.ignore /tmp/rgtemp) +# sort the .license.ignore file as sorting seems to behave differently on different platforms +cat .license.ignore | sort > /tmp/.license.ignore + +DIFFS=$(diff -u /tmp/.license.ignore /tmp/rgtemp) if [ -n "$DIFFS" ]; then echo "New files detected that either need copyright/license identifiers added, or they need to be added to .license.ignore"