MCPcopy Create free account
hub / github.com/ByBrawe/opencode-loop / help

Function help

scripts/loopd.mjs:165–183  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

163}
164
165function 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
173function 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.",

Callers 1

loopd.mjsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected