kairos-sdk/bus/hooks.go
Itxaka 3163cfbac0 Extract sdk into its own lib
This had some side effects:

 - Have to add some utils from the kairos/machine modules, which IMHO
   should not be there, they should be here if the are generic enough
 - Dropping the sdk dir, just have the modules in the root dir

Signed-off-by: Itxaka <itxaka.garcia@spectrocloud.com>
2023-03-15 10:56:11 +01:00

19 lines
248 B
Go

package bus
import (
"os"
"os/exec"
)
func RunHookScript(s string) error {
_, err := os.Stat(s)
if err != nil {
return nil
}
cmd := exec.Command(s)
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
cmd.Stdin = os.Stdin
return cmd.Run()
}