2019-02-05 19:30:40 -08:00
|
|
|
#!/bin/bash
|
2020-02-13 12:11:29 -08:00
|
|
|
if [ "$1" == "-h" ] ; then
|
|
|
|
|
echo "
|
|
|
|
|
woola shell script - a helper app to invoke the woola markdown content build or server programs
|
|
|
|
|
|
|
|
|
|
Usage: woola
|
2020-05-10 22:25:36 -07:00
|
|
|
woola --build
|
|
|
|
|
|
2020-02-13 12:11:29 -08:00
|
|
|
By default this app will serve files from the current directory by default using woola.
|
2020-05-10 22:25:36 -07:00
|
|
|
|
2021-03-30 00:37:43 -07:00
|
|
|
Takes an optional flag of those listed below. For example '--build' to build website files instead of serving.
|
2020-05-10 22:25:36 -07:00
|
|
|
|
|
|
|
|
Optional arguments passed to woola/lib/index.js:
|
|
|
|
|
.option('-b, --build', 'Build and write html to path {site.options.dstPath}')
|
|
|
|
|
.option('-c, --config [type]', 'config.js path [config]', null)
|
|
|
|
|
.option('-d, --dir [type]', 'Serve from directory [dir]', './')
|
|
|
|
|
.option('-s, --css [type]', 'uri path to css styles [css]', null)
|
|
|
|
|
.option('-p, --port [type]', 'Serve on port [port]', null)
|
|
|
|
|
.option('-a, --address [type]', 'Serve on ip/address [address]', 'localhost') //localhost or 127.0.0.1
|
|
|
|
|
.option('-h, --header [type]', 'Header .md file', null)
|
|
|
|
|
.option('-r, --footer [type]', 'Footer .md file', null)
|
|
|
|
|
.option('-n, --navigation [type]', 'Navigation .md file', null)
|
|
|
|
|
.option('-f, --file [type]', 'Open specific file in browser [file]')
|
|
|
|
|
.option('-x, --x', 'Don\'t open browser on run.')
|
|
|
|
|
.option('-v, --verbose', 'verbose output')
|
2020-02-13 12:11:29 -08:00
|
|
|
|
2021-03-30 00:37:43 -07:00
|
|
|
Installation: place in home bin directory and make this file executable chmod: u=rwX,go= woola
|
2020-02-13 12:11:29 -08:00
|
|
|
"
|
|
|
|
|
exit 0
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
2019-02-05 19:30:40 -08:00
|
|
|
#helper startup script for woola
|
|
|
|
|
appPath="$HOME/projects/dev/woola"
|
|
|
|
|
configFile=$HOME/.config/woola/config.js
|
2021-03-30 00:37:43 -07:00
|
|
|
optFlag=$@
|
2019-02-05 19:30:40 -08:00
|
|
|
|
|
|
|
|
if [[ -e $configFile ]] && [[ ! -e config.js ]]; then
|
|
|
|
|
ln -s $configFile config.js
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if [[ ! -d css ]]; then
|
|
|
|
|
ln -s $HOME/projects/dev/libcss css
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
#if [[ ! -d js ]]; then
|
|
|
|
|
# ln -s $appPath/js js
|
|
|
|
|
#fi
|
|
|
|
|
|
|
|
|
|
#if [[ ! -d figures ]]; then
|
|
|
|
|
# ln -s $HOME/figures figures
|
|
|
|
|
#fi
|
2020-05-10 22:25:36 -07:00
|
|
|
# if [[ "$optFlag" == "build" ]]; then
|
|
|
|
|
# node $appPath/lib/index --build
|
|
|
|
|
# else
|
|
|
|
|
# node $appPath/lib/index.js
|
|
|
|
|
# fi
|
|
|
|
|
|
2021-03-30 00:37:43 -07:00
|
|
|
# if [[ "$optFlag" ]]; then
|
|
|
|
|
# node $appPath/lib/index $optFlag
|
|
|
|
|
# else
|
|
|
|
|
# node $appPath/lib/index.js
|
|
|
|
|
# fi
|
|
|
|
|
|
|
|
|
|
node $appPath/lib/index $optFlag
|
2019-02-05 19:30:40 -08:00
|
|
|
|