MCPcopy Index your code
hub / github.com/semaphoreui/semaphore / makeShellCmd

Method makeShellCmd

db_lib/ShellApp.go:84–109  ·  view source on GitHub ↗
(args []string, environmentVars []string)

Source from the content-addressed store, hash-verified

82}
83
84func (t *ShellApp) makeShellCmd(args []string, environmentVars []string) *exec.Cmd {
85 var command string
86 var appArgs []string
87 switch t.App {
88 case db.AppBash:
89 command = "bash"
90 case db.AppPython:
91 command = "python3"
92 case db.AppPowerShell:
93 command = "powershell"
94 appArgs = []string{"-File"}
95 default:
96 command = string(t.App)
97 }
98
99 if app, ok := util.Config.Apps[string(t.App)]; ok {
100 if app.AppPath != "" {
101 command = app.AppPath
102 }
103 if app.AppArgs != nil {
104 appArgs = app.AppArgs
105 }
106 }
107
108 return t.makeCmd(command, append(appArgs, args...), environmentVars)
109}
110
111func (t *ShellApp) Run(args LocalAppRunningArgs) error {
112 // Use "default" key for backward compatibility

Callers 1

RunMethod · 0.95

Calls 2

makeCmdMethod · 0.95
appendFunction · 0.50

Tested by

no test coverage detected