Skip to content
This repository was archived by the owner on Jul 5, 2022. It is now read-only.

Commit d3fbb54

Browse files
committed
Update the script to deal with cross-references to .md files without extension
1 parent 1fe98f9 commit d3fbb54

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

add_zeroes.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ do
1616
done
1717

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

0 commit comments

Comments
 (0)