diff --git a/exec_extra/func.go b/exec_extra/func.go new file mode 100644 index 0000000..c539c61 --- /dev/null +++ b/exec_extra/func.go @@ -0,0 +1,13 @@ +package exec_extra + +import ( + `os/exec` +) + +func ExecCmdReturn(cmd *exec.Cmd) (exitStatus int, err error) { + // https://stackoverflow.com/a/55055100/733214 + err = cmd.Run() + exitErr, _ := err.(*exec.ExitError) + exitStatus = exitErr.ExitCode() + return +} diff --git a/paths/paths.go b/paths/func.go similarity index 100% rename from paths/paths.go rename to paths/func.go