diff options
Diffstat (limited to 'scripts/update-gitignore.sh')
-rwxr-xr-x | scripts/update-gitignore.sh | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/scripts/update-gitignore.sh b/scripts/update-gitignore.sh new file mode 100755 index 0000000..7b9fafe --- /dev/null +++ b/scripts/update-gitignore.sh @@ -0,0 +1,16 @@ +#+/bin/bash +BEGIN_MARKER="# begin generated files" +END_MARKER="# end 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 + echo "${f}" >> .gitignore +done +echo ${END_MARKER} >> .gitignore |