func runCmd()

in main/utils.go [141:157]


func runCmd(lg ExtensionLogger, cmd string, dir string, cfg handlerSettings) (code int, err error) {
	lg.customLog(logEvent, "executing command", logOutput, dir)

	begin := time.Now()
	code, err = ExecCmdInDir(lg, cmd, dir)
	elapsed := time.Now().Sub(begin)
	isSuccess := err == nil

	lg.customLog(logEvent, "command executed", "command", cmd, "isSuccess", isSuccess, "time elapsed", elapsed)

	if err != nil {
		lg.customLog(logEvent, "failed to execute command", logError, err, logOutput, dir)
		return code, errors.Wrap(err, "failed to execute command")
	}
	lg.customLog(logEvent, "executed command", logOutput, dir)
	return code, nil
}