aboutsummaryrefslogtreecommitdiff
path: root/bin/migrate.sh
blob: 8b6db201aa0789553453a0798f4b92592fcbd1b6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
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