-
-
Save eldargab/41cd15d3712d7a1cd586 to your computer and use it in GitHub Desktop.
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 | |
if [ -z "$LT_HOME" ] | |
then | |
if [ -L $0 ]; then | |
myDir="`dirname $(readlink $0)`" | |
else | |
myDir=$(dirname $0) | |
fi | |
myAppDir="$myDir/../Applications" | |
for i in ~/Applications ~/Applications/LightTable $myDir $myDir/LightTable $myAppDir $myAppDir/LightTable /Applications /Applications/LightTable /Applications/Utilities /Applications/Utilities/LightTable; do | |
if [ -x "$i/LightTable.app" ]; then | |
APP_DIR="$i" | |
break | |
fi | |
done | |
else | |
APP_DIR=$LT_HOME | |
fi | |
if [ -z "$APP_DIR" ] | |
then | |
echo "Sorry, cannot find LightTable.app. Try setting the LT_HOME environment variable to the directory containing LightTable.app." | |
exit 1 | |
fi | |
LTAPPCLI=$APP_DIR/LightTable.app/Contents/MacOS/node-webkit | |
PWD=`pwd` | |
ARGS="$@" | |
CORRECTED=${ARGS//-/<d>} | |
CORRECTED=${CORRECTED// /<s>} | |
if [ $# != 0 ]; then | |
LTCLI=true $LTAPPCLI "<d><d>dir=$PWD<s>$CORRECTED" & | |
else | |
LTCLI=true $LTAPPCLI & | |
fi | |
open -a LightTable |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment