summaryrefslogtreecommitdiff
path: root/scripts/open-docs
diff options
context:
space:
mode:
authorNathaniel Graff <nathaniel.graff@sifive.com>2019-06-05 19:52:53 +0000
committerGitHub <noreply@github.com>2019-06-05 19:52:53 +0000
commit1870b34bd69142910688f7a96b36397dae1c670d (patch)
tree5d650e6ea97e535388f831a09b2e065ba478e214 /scripts/open-docs
parente11e2a064dd91a11296a69192ae70f3418141d5a (diff)
parent7a27caa5f451fc96b620a0582bad3c780ef8bdef (diff)
Merge pull request #265 from sifive/open-docs
Add make target to open local documentation
Diffstat (limited to 'scripts/open-docs')
-rwxr-xr-xscripts/open-docs20
1 files changed, 20 insertions, 0 deletions
diff --git a/scripts/open-docs b/scripts/open-docs
new file mode 100755
index 0000000..82d0f91
--- /dev/null
+++ b/scripts/open-docs
@@ -0,0 +1,20 @@
+#!/usr/bin/env sh
+
+SDK_PATH="$( cd "$(dirname "$0")/.." ; pwd -P )"
+DOCS_PATH=$SDK_PATH/doc/html/index.html
+
+XDG_OPEN=`which xdg-open`
+OPEN=`which open`
+
+if [ "$XDG_OPEN" != "" ]; then
+ echo "Opening $DOCS_PATH"
+ $XDG_OPEN $DOCS_PATH
+
+elif [ "$OPEN" != "" ]; then
+ echo "Opening $DOCS_PATH"
+ $OPEN $DOCS_PATH
+
+else
+ echo "Please open $DOCS_PATH in your preferred HTML viewer"
+fi
+