diff --git a/scripts/build b/scripts/build index 7ebe83af..fd0305e0 100755 --- a/scripts/build +++ b/scripts/build @@ -1,6 +1,7 @@ #!/bin/bash export LANG=en_US.UTF-8 +WEBROOT=${WEBROOT:-$HOME/www} function timestamp { date "+%Y%m%d %H:%M %z" @@ -12,12 +13,11 @@ function unix_timestamp { function melpa { timestamp - timestamp > $HOME/www/status.txt - echo "building..." >> $HOME/www/status.txt + timestamp > $WEBROOT/status.txt + echo "building..." >> $WEBROOT/status.txt MELPADIR=${MELPADIR:-$HOME/melpa} MELPABRANCH=${MELPABRANCH:-master} - WEBROOT=${WEBROOT:-$HOME/www} PATH=$HOME/.cabal/bin:$HOME/usr/bin:$HOME/bin:$PATH @@ -55,14 +55,14 @@ function melpa { /usr/sbin/sendmail dcurtis@milkbox.net < ${EMAIL} cat ${ENVLOG} ${STDERR} ${STDOUT} | tee $WEBROOT/lastrun.txt - timestamp > $HOME/www/status.txt - echo "completed" >> $HOME/www/status.txt - echo '{"completed":' `unix_timestamp` '}' > $HOME/www/build-status.json + timestamp > $WEBROOT/status.txt + echo "completed" >> $WEBROOT/status.txt + echo '{"completed":' `unix_timestamp` '}' > $WEBROOT/build-status.json } -if [[ `cat $HOME/www/updatemelpa.txt` == 1 ]] ; then +if [[ `cat $WEBROOT/updatemelpa.txt` == 1 ]] ; then echo "Running MELPA" - echo "2" > $HOME/www/updatemelpa.txt + echo "2" > $WEBROOT/updatemelpa.txt melpa - echo "0" > $HOME/www/updatemelpa.txt + echo "0" > $WEBROOT/updatemelpa.txt fi