#!/bin/bash

# Publish site changes to staging site

URL="staging.openbudgetoakland.org"
FILE="../_staging/CNAME"
COUNTER=$((COUNTER+1))

# go to the 'source file' directory
cd _src
# compile files to 'staging' directory
harp compile ./ ../_staging
# update CNAME file with staging url
echo $URL > $FILE
# ask for description of commit
echo "Briefly describe your changes: "
read MESSAGE
# commit preview files and push to github
cd ../_staging && git add -A && git commit -m "$TIMESTAMP: $MESSAGE" && git push

#!/bin/bash

# Publish site changes to staging site

URL="staging.openbudgetoakland.org"
BASEDIR=$(dirname $0)
FILE="../_staging/CNAME"
COUNTER=$((COUNTER+1))

# go to the 'source file' directory
cd $BASEDIR/_src
# compile files to 'staging' directory
harp compile ./ ../_staging
# update CNAME file with staging url
echo $URL > $FILE
# ask for description of commit
echo "Briefly describe your changes: "
read MESSAGE
# commit preview files and push to github
cd $BASEDIR/_staging && git add -A && git commit -m "$TIMESTAMP: $MESSAGE" && git push

--- 
+++ 
@@ -3,11 +3,12 @@
 # Publish site changes to staging site
 
 URL="staging.openbudgetoakland.org"
+BASEDIR=$(dirname $0)
 FILE="../_staging/CNAME"
 COUNTER=$((COUNTER+1))
 
 # go to the 'source file' directory
-cd _src
+cd $BASEDIR/_src
 # compile files to 'staging' directory
 harp compile ./ ../_staging
 # update CNAME file with staging url
@@ -16,4 +17,4 @@
 echo "Briefly describe your changes: "
 read MESSAGE
 # commit preview files and push to github
-cd ../_staging && git add -A && git commit -m "$TIMESTAMP: $MESSAGE" && git push
+cd $BASEDIR/_staging && git add -A && git commit -m "$TIMESTAMP: $MESSAGE" && git push
: Deploy interim new flow diagram design to staging site
