targetable directoies are now a thing

This commit is contained in:
shockrahwow 2019-04-26 15:33:30 -07:00
parent cefa01567f
commit b93c7e2da3

12
make.sh
View File

@ -1,5 +1,6 @@
#!/bin/bash
rootDir='./tmp/'
targetDir=''
[[ -z $rootDir/post/ ]] && mkdir -p $rootDir/post
@ -13,11 +14,18 @@ post() {
sed -i "s/<img/<img class=\"pure-img\"/g" $tmp
sed -i 's/<table>/<table class="pure-table">/g' $tmp
# finally move this post to its proper location in the _rootDir
mv $tmp "$rootDir/post/${base%.*}.html"
mv $tmp "$rootDir/$targetDir/${base%.*}.html"
rm -f $tmp
}
target=""
if [[ $1 == "r" ]]
then
targetDir=''
shift
else
targetDir='post/'
fi
for file in $@;do
post $file
done