Skip to content

Commit

Permalink
Update the script to deal with cross-references to .md files without …
Browse files Browse the repository at this point in the history
…extension
  • Loading branch information
meiamsome committed May 2, 2018
1 parent 1fe98f9 commit d3fbb54
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions add_zeroes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ do
done

# _CodingChallenges
for i in $(find _CodingChallenges/ -maxdepth 1 -name [0-9]* | cut -b 19-)
for i in $(find _CodingChallenges/ -maxdepth 1 -name [0-9]* | cut -b 19- | sed 's/.md$//')
do
echo "Renaming $i => 0$i"
grep -rInEl $i . | xargs -r -L 1 -o sed -i -e "s/$i/0$i/g"
mv "_CodingChallenges/$i" "_CodingChallenges/0$i"
sed -i "3iredirect_from: CodingChallenges/`echo $i | sed 's/.md$/.html/'`" "_CodingChallenges/0$i"
mv "_CodingChallenges/$i.md" "_CodingChallenges/0$i.md"
sed -i "3iredirect_from: CodingChallenges/$i.html" "_CodingChallenges/0$i.md"
done

0 comments on commit d3fbb54

Please sign in to comment.