fix: allow just binary execution
This commit is contained in:
7
main.go
7
main.go
@@ -27,6 +27,7 @@ func main() {
|
||||
if err != nil {
|
||||
log.Fatalf("Error loading config: %v", err)
|
||||
}
|
||||
log.Println("GOOO")
|
||||
http.HandleFunc("/", handlePayload(cfg.Secret, cfg.Projects))
|
||||
http.ListenAndServe(fmt.Sprintf(":%d", cfg.Port), nil)
|
||||
}
|
||||
@@ -80,15 +81,15 @@ func handlePayload(secret string, projects map[string][]config.ConfigScript) fun
|
||||
}
|
||||
|
||||
go func() {
|
||||
if err := execute(scr.BinaryPath, scr.ScriptPath); err != nil {
|
||||
if err := execute(scr.Command, scr.Arguments); err != nil {
|
||||
log.Println(err)
|
||||
}
|
||||
}()
|
||||
})
|
||||
}
|
||||
|
||||
func execute(binaryPath, scriptPath string) error {
|
||||
cmd := exec.Command(binaryPath, scriptPath)
|
||||
func execute(command, args string) error {
|
||||
cmd := exec.Command(command, args)
|
||||
cmd.Stdout = os.Stdout
|
||||
cmd.Stderr = os.Stderr
|
||||
|
||||
|
||||
Reference in New Issue
Block a user