Permalink
Browse files

kranc: Add some error-checking and information to the launch script

  • Loading branch information...
ianhinder committed Oct 6, 2011
1 parent 136b194 commit ad5d11b6f6ee7d69ce3947c265c9e1e429df739a
Showing with 14 additions and 1 deletion.
  1. +14 −1 Bin/kranc
View
@@ -1,9 +1,22 @@
#!/bin/bash
-# Assume that this script is called from the Kranc/Bin directory
+set -e
+
+# Assume that this script is called from the Kranc/Bin directory.
+# This will not work if someone creates a symlink to the kranc script
+# somewhere else
export KRANCDIR=$(dirname $0)/..
+
+if [ ! -r "$KRANCDIR/Tools/CodeGen" ]; then
+ echo "Cannot find Kranc (the kranc script must be run directly from the Kranc/Bin directory - symbolic links are not currently allowed)"
+ exit 1
+fi
+
export KRANCVERBOSE=no
+echo "Using Kranc installation at $KRANCDIR"
+# It would be good to find a portable way to canonicalise KRANCDIR.
+
while getopts "v" flag
do
case $flag in

0 comments on commit ad5d11b

Please sign in to comment.