# This file converts all md files to html

echo "Starting the conversion"
pandoc -s -t html -c styles.css index.md -o index.html
pandoc -s -t html -c styles.css 3dprinters-scanning/3dprinters-scanning.md -o 3dprinters-scanning/3dprinters-scanning.html
pandoc -s -t html -c styles.css linux/linux.md -o linux/linux.html
pandoc -s -t html -c styles.css electronics/electronics.md -o electronics/electronics.html
pandoc -s -t html -c styles.css introduction/introduction.md -o introduction/introduction.html
pandoc -s -t html -c styles.css cad/3dDesign.md -o cad/3dDesign.html
pandoc -s -t html -c styles.css shopbot.md -o shopbot.html
pandoc -s -t html -c styles.css vinyl-cutter/vinyl-cutter.md -o vinyl-cutter/vinyl-cutter.html
pandoc -s -t html -c styles.css principles.md -o principles.html
pandoc -s -t html -c styles.css C-programming/C-programming.md -o C-programming/C-programming.html
pandoc -s -t html -c styles.css finalProject.md -o finalProject.html
echo "All files converted to html"
echo "Pull"

if [ "$#" -gt 0 ]
then
cd ..
cd ..
git pull
git add --all
git commit -m "$*"
git pull && git push
else
  echo "Empty commit message"
fi