stash/pkg/exec/command.go
WithoutPants 0cd9a0a474
Python path setting (#2409)
* Add python package
* Add python path backend config
* Add python path to system settings page
* Apply python path to script scrapers and plugins
2022-03-24 09:22:41 +11:00

21 lines
699 B
Go

// Package exec provides functions that wrap os/exec functions. These functions prevent external commands from opening windows on the Windows platform.
package exec
import (
"context"
"os/exec"
)
// Command wraps the exec.Command function, preventing Windows from opening a window when starting.
func Command(name string, arg ...string) *exec.Cmd {
ret := exec.Command(name, arg...)
hideExecShell(ret)
return ret
}
// CommandContext wraps the exec.CommandContext function, preventing Windows from opening a window when starting.
func CommandContext(ctx context.Context, name string, arg ...string) *exec.Cmd {
ret := exec.CommandContext(ctx, name, arg...)
hideExecShell(ret)
return ret
}