aboutsummaryrefslogtreecommitdiff
path: root/bin/migrate_to_folder.sh
blob: 93e64f26fc498aee2e119c68893e314d4bc918af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/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