| 82 | } |
| 83 | |
| 84 | func (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 | |
| 111 | func (t *ShellApp) Run(args LocalAppRunningArgs) error { |
| 112 | // Use "default" key for backward compatibility |