forked from franks42/clojure.tmbundle
/
Labrepl start.tmCommand
34 lines (30 loc) · 1.11 KB
/
Labrepl start.tmCommand
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>beforeRunningCommand</key>
<string>nop</string>
<key>command</key>
<string>if [ -d "$TM_PROJECTS_DIR/labrepl" ]
then
cd "$TM_PROJECTS_DIR/labrepl"
cake eval -q "(require 'labrepl)(labrepl/-main)"
setname=`echo "set name to \"labrepl\""`
cdcmd=`echo "write text \"cd $TM_PROJECTS_DIR/labrepl\""`
replcmd=`echo "write text \"cake repl\""`
osascript -e 'tell app "iTerm"' -e 'activate' -e 'set myterm to first terminal' -e 'tell myterm' -e 'launch session "Default"' -e 'set mysession to last session' -e 'tell mysession' -e "$setname" -e "$cdcmd" -e "$replcmd" -e 'end tell' -e 'end tell' -e 'end tell'
open "http://localhost:8080"
else
echo 'No "labrepl" project found...maybe install first (?)'
fi
</string>
<key>input</key>
<string>none</string>
<key>name</key>
<string>Labrepl start</string>
<key>output</key>
<string>showAsHTML</string>
<key>uuid</key>
<string>7895C5AB-40BC-4D70-B4D3-9E86DF536E9D</string>
</dict>
</plist>