Bash GitBook - Build and Archive PDF + HTML

#!/bin/bash # Defs projectName=mygitbook; projtimestamp=`date +%Y-%m-%d`; sourceDir=/Users/$USER/GitBook/Library/Import; outputDir=/Users/$USER/GitBooks; projectSource=$sourceDir/$projectName; projectOutputHTML=$outputDir/$projectName/$projectName-$HTML; projectOutputPDF=$outputDir/$projectName/$projectName-$PDF; # Clean rm -rf $projectOutputHTML; rm $projectOutputPDF; # Build gitbook build $projectSource $projectOutputHTML; gitbook pdf $projectSource $projectOutputPDF; # Archive oldDir=$PWD; cd $outputDir; rm -rf $projectName.$timestamp.tar.gz tar -zcvf $projectName.$timestamp.tar.gz $projectName cd $oldDir;

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.