You've already forked filebrowser
mirror of
https://github.com/filebrowser/filebrowser.git
synced 2025-11-26 14:25:26 +08:00
Hugo Updates
Former-commit-id: 35d71feaf1921d3b965331e02ac45274a24e1d5f [formerly 98ad98d2326fee3f4dc318f0597f53688704ecfe] [formerly 0d02b487fd32a169a4f1133e086058f1db3df108 [formerly b863033d7a]]
Former-commit-id: 3fc286e691e56c3ff03b0e50ea89adf586a86789 [formerly 2b4bbc4ce6bab8c69c9baa3653480221a1ff71d2]
Former-commit-id: 83d23b6b60d00b6499729e145074396c7ffbc06d
This commit is contained in:
19
plugins/utils.go
Normal file
19
plugins/utils.go
Normal file
@@ -0,0 +1,19 @@
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user