(cmdStr string)
| 69 | } |
| 70 | |
| 71 | func (self *Shell) RunShellCommand(cmdStr string) *Shell { |
| 72 | shell := "sh" |
| 73 | shellArg := "-c" |
| 74 | if runtime.GOOS == "windows" { |
| 75 | shell = "cmd" |
| 76 | shellArg = "/C" |
| 77 | } |
| 78 | |
| 79 | cmd := exec.Command(shell, shellArg, cmdStr) |
| 80 | cmd.Env = self.env |
| 81 | cmd.Dir = self.dir |
| 82 | |
| 83 | output, err := cmd.CombinedOutput() |
| 84 | if err != nil { |
| 85 | self.fail(fmt.Sprintf("error running shell command: %s\n%s", cmdStr, string(output))) |
| 86 | } |
| 87 | |
| 88 | return self |
| 89 | } |
| 90 | |
| 91 | func (self *Shell) CreateFile(path string, content string) *Shell { |
| 92 | fullPath := filepath.Join(self.dir, path) |
no test coverage detected