tell git to ignore modified `apps.json` when running create_apps.json.sh

Only if no arguments given: `create_apps_json.sh apps.json` will leave
it alone if someone really wants to overwrite+commit apps.json.
pull/1324/head
Richard de Boer 2022-01-20 20:39:06 +01:00
parent e75a828fce
commit 46fbccf711
No known key found for this signature in database
GPG Key ID: 8721727971871937
1 changed files with 10 additions and 0 deletions

View File

@ -36,3 +36,13 @@ for app in apps/*/; do
fi fi
done done
echo "]" >> "$outfile" echo "]" >> "$outfile"
if [ -z "$1"]; then
# Running with no arguments: prevent accidental commit of modified apps.json.
# You can use `create_apps.json.sh apps.json` if you really want to both
# overwrite and still commit apps.json
git update-index --skip-worktree apps.json
echo "Told git to ignore modified apps.json."
# If you want to unignore it, use
# 'git update-index --no-skip-worktree apps.json'
fi