-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathrun_fast.sh
executable file
·47 lines (35 loc) · 1.08 KB
/
run_fast.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
41
42
43
44
45
46
47
#!/bin/bash
# Start Vapor server
#rm -rf ./SwiftSageServer/.build
lsof -i :8080 -sTCP:LISTEN | awk 'NR > 1 {print $2}' | xargs kill -15
killall SwiftSageStatusBar
### 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
## USE THIS FOR iTerm2.app
# cwd=$(pwd)
# bar="${cwd}/SwiftSageServer"
# osascript - "$bar" <<EOF
# on run argv
# tell application "iTerm2"
# set newWindow to (create window with default profile)
# tell current session of newWindow
# write text "cd " & quoted form of item 1 of argv & " ; swift run"
# end tell
# end tell
# end run
# EOF
# Vapor starts too fast :*()
sleep 20
#rm -rf dd
## LAUNCH SWIFT SERVER COMMAND LINE BINARY
killall Swifty-GPT
xcodebuild -derivedDataPath dd -workspace Swifty-GPT.xcworkspace -scheme Swifty-GPT -configuration Debug build
./dd/Build/Products/Debug/Swifty-GPT