Created
May 28, 2013 20:05
-
-
Save anonymous/5665670 to your computer and use it in GitHub Desktop.
Light table launcher script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
LT=LightTable | |
# adapted from http://stackoverflow.com/questions/59895/can-a-bash-script-tell-what-directory-its-stored-in | |
SOURCE="${BASH_SOURCE[0]}" | |
while [ -h "$SOURCE" ]; do | |
HERE="$( cd -P "$( dirname "$SOURCE" )" && pwd )" | |
SOURCE="$(readlink "$SOURCE")" | |
[[ $SOURCE != /* ]] && SOURCE="$HERE/$SOURCE" | |
done | |
HERE="$( cd -P "$( dirname "$SOURCE" )" && pwd )" | |
# adapted from http://github.com/Kodowa/Light-Table-Playground/issues/161#issuecomment-12392465 | |
warn() { | |
echo "Make sure you have libudev.so.0 symlinked in $HERE to your version of libudev" | |
exit 2 | |
} | |
[[ -e "$HERE/libudev.so.0" ]] || warn | |
if [[ -n "$LD_LIBRARY_PATH" ]]; then | |
LD_LIBRARY_PATH="$HERE:/lib:$LD_LIBRARY_PATH" | |
else | |
LD_LIBRARY_PATH="$HERE:/lib" | |
fi | |
export LD_LIBRARY_PATH | |
exec -a "$0" "$HERE/$LT" "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment