aboutsummaryrefslogtreecommitdiff
path: root/bin/migrate.sh
diff options
context:
space:
mode:
authorkaotisk <kaotisk@arching-kaos.com>2021-11-19 23:05:25 +0200
committerkaotisk <kaotisk@arching-kaos.com>2021-11-19 23:05:25 +0200
commit3144d9037983d750d2e0bca22c8a1dd6910dbb7a (patch)
tree5cda5d259932150b4c2b30169684e00fa56c0add /bin/migrate.sh
parentc5c44855b3df2e1af900e3c35af7ac77d02ae1bd (diff)
download01-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/migrate.sh')
-rwxr-xr-xbin/migrate.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/bin/migrate.sh b/bin/migrate.sh
new file mode 100755
index 0000000..8b6db20
--- /dev/null
+++ b/bin/migrate.sh
@@ -0,0 +1,13 @@
+#!/bin/bash
+echo "Migration tool: please run only once"
+FILES=$(ls -1 | grep 202)
+for file in $FILES; do
+ if [ -f $file ]
+ then
+ title="$(head -n 1 $file)"
+ new_name="$file-$(echo "$title" | tr '[:upper:]' '[:lower:]' | sed -e 's/ /\_/g')"
+ mv $file $new_name
+ git add $file $new_name
+ git commit -m "Migrated to new naming $file to $new_name";
+ fi
+done