func ExecCmd(name string, args ...string) (string, error) {
	// first we check if there is a git installation already
	stdout, stderr, err := runcmd(name, args...)
	if err != nil {
		log.WithError(err).WithField("name", name).Debugln("command triggered an error")
		exitCode := extractExitCode(err)
		if exitCode == defaultFailedCode {
			return "", notFoundErr
		}

		if len(stderr) > 0 {
			return "", &ExecErr{RuntimeErr, string(stderr)}
		}

		return "", &ExecErr{UnexpectedErr, err.Error()}
	}

	return string(stdout), nil
}
// ExecCmd executes a command and returns the exitcode as well as the stdout
// and stderr of the command executed. Returns the stdout or an ExecErr
// wrapping the stderr
ExecCmd executes a command and returns the exitcode as well as the stdout
and stderr of the command executed. Returns the stdout or an ExecErr
wrapping the stderr
// ExecCmd executes a command and returns the exitcode as well as the stdout // and stderr of the command executed . Returns the stdout or an ExecErr // wrapping the stderr
func ExecCmd(name string, args ...string) (string, error) {
	stdout, stderr, err := runcmd(name, args...)
	if err != nil {
		log.WithError(err).WithField("name", name).Debugln("command triggered an error")
		exitCode := extractExitCode(err)
		if exitCode == defaultFailedCode {
			return "", notFoundErr
		}
		if len(stderr) > 0 {
			return "", &ExecErr{RuntimeErr, string(stderr)}
		}
		return "", &ExecErr{UnexpectedErr, err.Error()}
	}
	return string(stdout), nil
}
func ExecCmd ( name string , args ... string ) ( string , error ) { stdout , stderr , err := runcmd ( name , args ... ) if err != nil { log . WithError ( err ) . WithField ( " " , name ) . Debugln ( " " ) exitCode := extractExitCode ( err ) if exitCode == defaultFailedCode { return " " , notFoundErr } if len ( stderr ) > 0 { return " " , & ExecErr { RuntimeErr , string ( stderr ) } } return " " , & ExecErr { UnexpectedErr , err . Error ( ) } } return string ( stdout ) , nil }
ExecCmd executes a command and returns the exitcode as well as the stdout
and stderr of the command executed.
ExecCmd executes a command and returns the exitcode as well as the stdout and stderr of the command executed .
// first we check if there is a git installation already