コード例 #1
0
ファイル: command.go プロジェクト: yext/edward
func (s *Script) GetCommand(logger common.Logger) (*exec.Cmd, error) {
	args := []string{
		"run",
		s.Path,
		s.Log,
		s.Command,
	}

	if logger != nil {
		logger.Printf("Generating script command: %v %v", os.Args[0], args)
	}

	cmd := exec.Command(os.Args[0], args...)
	// TODO: Cache all output from the command and output it on failure as needed
	cmd.Stderr = os.Stderr
	cmd.SysProcAttr = &syscall.SysProcAttr{Setpgid: true}
	return cmd, nil
}
コード例 #2
0
ファイル: updates.go プロジェクト: yext/edward
func printf(logger common.Logger, f string, v ...interface{}) {
	if logger != nil {
		logger.Printf(f, v...)
	}
}