From 40afc66f61489d6f744fd2cf6c1674d2d77a9227 Mon Sep 17 00:00:00 2001 From: AlejandroS Date: Fri, 22 Jun 2018 19:44:06 -0700 Subject: [PATCH] help command done --- .gitignore | 1 + make.sh | 29 +++++++++++++++++++++++++---- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 1377554..d441580 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ *.swp +test* diff --git a/make.sh b/make.sh index e831bb7..2620aa3 100755 --- a/make.sh +++ b/make.sh @@ -1,10 +1,19 @@ +# not only updates the post but inserts the description found in desc.md into the index.md then recompiles +# only gets called if post() { # check directory existence if [ -f markdown/post/$1 ] then + # compile the new post and drop it in ./post/ pandoc markdown/post/$1 --css bstyle.css -s -o post/${1%.*}.html + # check to see if we have to rebuild the post or not + if [ $2 == "n" ] + then + echo "changing index.html for brand new post" + fi else - echo "Check parameters as well: ./make.sh fileType inputFile" + # error message incase file was not found + echo "File \"$1\" not found in markdown/post" fi } @@ -19,9 +28,21 @@ page() { } help() { - echo "Usage: \./make.sh fileType targetSource" - echo "fileType - \[post, page\] - specifices type of html doc to create" - echo "targetSource - the file itself that you created in the /markdown directory" + case $1 in + type) + echo -e "[post, page] \n\tThe kind of page you want to add to the site" + echo "Different types result in different compilation locations" + ;; + target) + echo "The file that you want to actually compile to html" + ;; + flag) + echo -e "Available flags:\n\tr - rebuilds file, does not update index.html\n\tn - builds file, updates index.html" + echo -e "\t*Pages will not update index.html*" + ;; + *) + echo "./make.sh type target.md flag" + esac } "$@"