summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorThomas Letan <lthms@soap.coffee>2020-02-05 21:54:05 +0100
committerThomas Letan <lthms@soap.coffee>2020-02-05 21:54:05 +0100
commit0b6c22e4fba44a28d777d3c1cc21953c0328c7bd (patch)
treeca7f2605126e2b7988651f206781e76d3c0332bc /scripts
parentMake the output of `make` cleaner (diff)
Add minimal comments to the script that keep .gitignore up-to-date
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/update-gitignore.sh3
1 files changed, 3 insertions, 0 deletions
diff --git a/scripts/update-gitignore.sh b/scripts/update-gitignore.sh
index ea8a019..ef03d3b 100755
--- a/scripts/update-gitignore.sh
+++ b/scripts/update-gitignore.sh
@@ -3,9 +3,12 @@
BEGIN_MARKER="# begin generated files"
END_MARKER="# begin generated files"
+# remove the previous list of generated files to ignore
sed -i -e "/${BEGIN_MARKER}/,/${END_MARKER}/d" .gitignore
+# remove trailing empty lines
sed -i -e :a -e '/^\n*$/{$d;N;};/\n$/ba' .gitignore
+# output the list of files to ignore
echo "" >> .gitignore
echo ${BEGIN_MARKER} >> .gitignore
for f in $@; do