From 0b6c22e4fba44a28d777d3c1cc21953c0328c7bd Mon Sep 17 00:00:00 2001 From: Thomas Letan Date: Wed, 5 Feb 2020 21:54:05 +0100 Subject: Add minimal comments to the script that keep .gitignore up-to-date --- scripts/update-gitignore.sh | 3 +++ 1 file changed, 3 insertions(+) (limited to 'scripts') 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 -- cgit v1.2.3