-
Notifications
You must be signed in to change notification settings - Fork 0
/
cleo_launcher.go
34 lines (29 loc) · 1.2 KB
/
cleo_launcher.go
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
package main
import (
"fmt"
"github.com/cheikhshift/gos/core"
"io/ioutil"
"path/filepath"
)
func LaunchApp(cmmand string, test Test, app App) {
var shscript string
if !isWindows {
if !test.NoBuild {
shscript = fmt.Sprintf(BuildScript, cmmand, filepath.Join(cleoWorkspace, test.ID), filepath.Join(cleoWorkspace, app.ID), serverWaitTime, filepath.Join(cleoWorkspace, test.ID))
} else {
shscript = fmt.Sprintf(LaunchScript, cmmand, filepath.Join(cleoWorkspace, test.ID))
}
bspath := filepath.Join(cleoWorkspace, fmt.Sprintf("%s.sh", test.ID))
ioutil.WriteFile(bspath, []byte(shscript), 0777)
core.RunCmdSmart(fmt.Sprintf("sh %s &>/dev/null", bspath))
} else {
if !test.NoBuild {
shscript = fmt.Sprintf(BatchBuildScript, filepath.Join(cleoWorkspace, test.ID), filepath.Join(cleoWorkspace, app.ID), serverWaitTime,filepath.Join(dfd, "bin") ,cmmand, filepath.Join(cleoWorkspace, test.ID))
} else {
shscript = fmt.Sprintf(BatchLaunchScript, filepath.Join(dfd, "bin"),cmmand, filepath.Join(cleoWorkspace, test.ID))
}
bspath := filepath.Join(cleoWorkspace, fmt.Sprintf("%s.bat", test.ID))
ioutil.WriteFile(bspath, []byte(shscript), 0777)
core.RunCmdSmart(fmt.Sprintf("cmd /C %s", bspath))
}
}