-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathrun.sh
executable file
·40 lines (27 loc) · 911 Bytes
/
run.sh
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
35
36
37
38
39
40
#!/bin/bash
# TODO: Change to use passed or ENV VAR
cd ~/LogicSage/
lsof -i :8080 -sTCP:LISTEN | awk 'NR > 1 {print $2}' | xargs kill -15
killall SwiftSageStatusBar
killall LogicSageCommandLine
### USE THIS FOR Terminal.app
cwd=$(pwd)
bar="${cwd}/SwiftSageServer"
osascript - "$bar" <<EOF
on run argv
tell application "Terminal"
do script( "cd " & quoted form of item 1 of argv & " ; swift run")
end tell
end run
EOF
# ## LAUNCH SWIFT SERVER COMMAND LINE BINARY
sleep 20
# rm -rf dd
cwd=$(pwd)
osascript - "$cwd" <<EOF
on run argv
tell application "Terminal"
do script( "cd " & quoted form of item 1 of argv & " ; xcodebuild -derivedDataPath dd -workspace LogicSageCommandLine.xcworkspace -scheme LogicSageCommandLine -configuration Debug clean build ; dd/Build/Products/Debug/LogicSageCommandLine")
end tell
end run
EOF