build all ready to be used in a pipeline later

This commit is contained in:
shockrah 2019-09-13 21:58:46 -07:00
parent 29aa8a72bb
commit 99f2489dee

30
make
View File

@ -1,5 +1,5 @@
#!/bin/bash
rootDir='./site/'
rootDir='./tmp/'
targetDir='post/'
if [ -f .creds ]
then
@ -9,6 +9,7 @@ fi
# auto tools should be able to fix this
post() {
echo Building: $1
tmp=".swap"
full=".fullswap"
base=`basename $1`
@ -24,11 +25,21 @@ post() {
rm -f $tmp
}
upload() {
cd $rootDir
name=''
# first the root pages
find -type f | xargs 'name=basename %';curl -f "$name=@%" $url
build_all() {
mkdir -p $rootDir/post/ $rootDir/fonts/
cp style.css "$rootDir"
cp style.css "$rootDir/$targetDir"
cp fonts/* $rootDir/fonts/
# Try to get xargs to deal with this ugliness
for r in prebuild/*md;do
post $r
done
for p in prebuild/post/*md;do
post $p
done
}
_help() {
@ -39,23 +50,22 @@ _help() {
-s copy stylesheets
-l run live server'
}
server() {
cd $rootDir
echo 'Address: 0.0.0.0:8080'
python -m SimpleHTTPServer 8080
}
mkdir -p "$rootDir/post"
if [ -z $1 ]
then
_help
exit 0
fi
while getopts ":slrhup:" opt;do
while getopts ":aslrhup:" opt;do
case "$opt" in
a)
build_all;;
s)
cp style.css "$rootDir" # root stylesheet
cp style.css "$rootDir/$targetDir" # post stylesheet