| 163 | } |
| 164 | |
| 165 | function runSync(command, commandArgs) { |
| 166 | const options = { shell: false, stdio: "inherit", windowsHide: true } |
| 167 | const direct = spawnSync(command, commandArgs, options) |
| 168 | const extension = path.extname(String(command || "")).toLowerCase() |
| 169 | if (!direct.error || process.platform !== "win32" || direct.error.code !== "EINVAL" || ![".cmd", ".bat"].includes(extension)) return direct |
| 170 | return spawnSync("cmd.exe", ["/d", "/s", "/c", command, ...commandArgs], options) |
| 171 | } |
| 172 | |
| 173 | function readPrompt(project, options = {}) { |
| 174 | const promptFile = options.promptFile ?? arg("--prompt-file") |
| 175 | const promptArg = options.prompt ?? arg("--prompt") |
| 176 | |
| 177 | if (promptFile) { |
| 178 | return stripBom(fs.readFileSync(path.resolve(project, promptFile), "utf8")) |
| 179 | } |
| 180 | |
| 181 | if (promptArg) return promptArg |
| 182 | |
| 183 | return [ |
| 184 | "Continue from progress.md and implement the next unfinished TODO.", |
| 185 | "Do not ask questions.", |
| 186 | "Make reasonable assumptions.", |