summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorEvan Shelhamer <shelhamer@imaginarynumber.net>2014-04-02 18:38:20 -0700
committerEvan Shelhamer <shelhamer@imaginarynumber.net>2014-04-02 18:38:20 -0700
commit133dc18784d7f42ab0b993dfca1fdaee36cf7ce9 (patch)
tree71273843727ab0fd443d6d5b0107207042ebf02d /scripts
parent16ba42e2e3f8a13b5da8ffc6cbc2103eff426f28 (diff)
downloadcaffeonacl-133dc18784d7f42ab0b993dfca1fdaee36cf7ce9.tar.gz
caffeonacl-133dc18784d7f42ab0b993dfca1fdaee36cf7ce9.tar.bz2
caffeonacl-133dc18784d7f42ab0b993dfca1fdaee36cf7ce9.zip
make build_docs.sh script work from anywhere
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/build_docs.sh13
1 files changed, 8 insertions, 5 deletions
diff --git a/scripts/build_docs.sh b/scripts/build_docs.sh
index 1d4f16a4..1faf8bd5 100755
--- a/scripts/build_docs.sh
+++ b/scripts/build_docs.sh
@@ -1,8 +1,11 @@
#!/bin/bash
+PORT=${1:-4000}
+
echo "usage: build_docs.sh [port]"
-PORT=4000
-if [ $# -gt 0 ]; then
- PORT=$1
-fi
-jekyll serve -w -s docs/ -d docs/_site --port $PORT
+
+# Find the docs dir, no matter where the script is called
+DIR="$( cd "$(dirname "$0")" ; pwd -P )"
+cd $DIR/../docs
+
+jekyll serve -w -s . -d _site --port=$PORT