mirror of
https://github.com/taigrr/wails.git
synced 2026-04-02 05:08:54 -07:00
Updates to update command
This commit is contained in:
13
cmd/shell.go
13
cmd/shell.go
@@ -25,3 +25,16 @@ func (sh *ShellHelper) Run(command string, vars ...string) (stdout, stderr strin
|
||||
stderr = string(stde.Bytes())
|
||||
return
|
||||
}
|
||||
|
||||
// RunInDirectory runs the given command in the given directory
|
||||
func (sh *ShellHelper) RunInDirectory(dir string, command string, vars ...string) (stdout, stderr string, err error) {
|
||||
cmd := exec.Command(command, vars...)
|
||||
cmd.Dir = dir
|
||||
var stdo, stde bytes.Buffer
|
||||
cmd.Stdout = &stdo
|
||||
cmd.Stderr = &stde
|
||||
err = cmd.Run()
|
||||
stdout = string(stdo.Bytes())
|
||||
stderr = string(stde.Bytes())
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user