aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/add-new.sh6
-rwxr-xr-xbin/migrate.sh13
-rwxr-xr-xbin/migrate_to_folder.sh19
3 files changed, 3 insertions, 35 deletions
diff --git a/bin/add-new.sh b/bin/add-new.sh
index 086cff8..5685184 100755
--- a/bin/add-new.sh
+++ b/bin/add-new.sh
@@ -4,7 +4,7 @@ vi $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
+mv $NEWS_FILE news/$TO_FILE
echo "Adding to git repo..."
-git add $TO_FILE
-git commit -m "Added $NEWS_FILE with $(head -n 1 $TO_FILE)"
+git add news/$TO_FILE
+git commit -m "Added $TO_FILE with $(head -n 1 news/$TO_FILE)"
diff --git a/bin/migrate.sh b/bin/migrate.sh
deleted file mode 100755
index 8b6db20..0000000
--- a/bin/migrate.sh
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/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
diff --git a/bin/migrate_to_folder.sh b/bin/migrate_to_folder.sh
deleted file mode 100755
index 93e64f2..0000000
--- a/bin/migrate_to_folder.sh
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/bin/bash
-echo "Migration tool 2: please run only once"
-echo "Moves your news to a news folder"
-FILES=$(ls -1 | grep 202)
-if [ -d news ]
-then
- echo "news directory exists";
-else
- mkdir news;
-fi
-for file in $FILES; do
- if [ -f $file ]
- then
- new_name="news/"$file
- mv $file $new_name
- git add $file $new_name
- git commit -m "Moved $file to news folder";
- fi
-done