mirror of
https://github.com/filebrowser/filebrowser.git
synced 2024-06-07 23:00:43 +00:00
0d453229d9
Former-commit-id: 35d71feaf1921d3b965331e02ac45274a24e1d5f [formerly 98ad98d2326fee3f4dc318f0597f53688704ecfe] [formerly 0d02b487fd32a169a4f1133e086058f1db3df108 [formerly b863033d7a
]]
Former-commit-id: 3fc286e691e56c3ff03b0e50ea89adf586a86789 [formerly 2b4bbc4ce6bab8c69c9baa3653480221a1ff71d2]
Former-commit-id: 83d23b6b60d00b6499729e145074396c7ffbc06d
20 lines
305 B
Go
20 lines
305 B
Go
package plugins
|
|
|
|
import (
|
|
"errors"
|
|
"os/exec"
|
|
)
|
|
|
|
// Run executes an external command
|
|
func Run(command string, args []string, path string) error {
|
|
cmd := exec.Command(command, args...)
|
|
cmd.Dir = path
|
|
out, err := cmd.CombinedOutput()
|
|
|
|
if err != nil {
|
|
return errors.New(string(out))
|
|
}
|
|
|
|
return nil
|
|
}
|