Created
November 24, 2015 18:16
-
-
Save maxpeterson/af03b6fd75bb8bd47ca1 to your computer and use it in GitHub Desktop.
Rename slides in a jekyll edetail project
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
from=$1; shift | |
to=$1; shift | |
echo rename $from $to; | |
grep -rl --exclude-dir _site "$from" jekyll-project sass | xargs perl -pi -e "s|\Q$from|$to|g" | |
find jekyll-project sass -name \*"$from"\* -not -path jekyll-project/_site/\* -type d | while read path ; do | |
new=$(echo "$path" | replace "$from" "$to" --); | |
git mv "$path" "$new"; | |
done; | |
find jekyll-project sass -name \*"$from"\* -not -path jekyll-project/_site/\* -type f | while read path ; do | |
new=$(echo "$path" | replace "$from" "$to" --); | |
git mv "$path" "$new"; | |
done; | |
#git commit -a -m "Rename $from" -m "Rename $from to $to" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment