diff options
author | kaotisk <kaotisk@arching-kaos.com> | 2021-11-19 23:05:25 +0200 |
---|---|---|
committer | kaotisk <kaotisk@arching-kaos.com> | 2021-11-19 23:05:25 +0200 |
commit | 3144d9037983d750d2e0bca22c8a1dd6910dbb7a (patch) | |
tree | 5cda5d259932150b4c2b30169684e00fa56c0add /bin/add-new.sh | |
parent | c5c44855b3df2e1af900e3c35af7ac77d02ae1bd (diff) | |
download | 01-NEWS-3144d9037983d750d2e0bca22c8a1dd6910dbb7a.tar.gz 01-NEWS-3144d9037983d750d2e0bca22c8a1dd6910dbb7a.tar.bz2 01-NEWS-3144d9037983d750d2e0bca22c8a1dd6910dbb7a.zip |
Minor update on add-new.sh script, introducing a migration tool for the changes
Diffstat (limited to 'bin/add-new.sh')
-rwxr-xr-x | bin/add-new.sh | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/bin/add-new.sh b/bin/add-new.sh index c82bc70..086cff8 100755 --- a/bin/add-new.sh +++ b/bin/add-new.sh @@ -1,5 +1,10 @@ #!/bin/bash export NEWS_FILE="$(date +%Y%m%d_%H%M%S)" vi $NEWS_FILE -git add $NEWS_FILE -git commit -m "$(head -n 1 $NEWS_FILE)" +echo "Renaming..." +TITLE="$(head -n 1 $NEWS_FILE)" +TO_FILE=$NEWS_FILE-$(echo $TITLE | tr '[:upper:]' '[:lower:]' | sed -e 's/ /\_/g' ) +mv $NEWS_FILE $TO_FILE +echo "Adding to git repo..." +git add $TO_FILE +git commit -m "Added $NEWS_FILE with $(head -n 1 $TO_FILE)" |