| 50 | } |
| 51 | |
| 52 | function createFailingShell() { |
| 53 | const calls = [] |
| 54 | const shell = (strings, ...values) => { |
| 55 | calls.push(String.raw({ raw: strings }, ...values)) |
| 56 | const error = new Error("OpenCode plugin file probes must not use shell commands") |
| 57 | return { |
| 58 | then: (_resolve, reject) => reject(error), |
| 59 | text: async () => { |
| 60 | throw error |
| 61 | }, |
| 62 | } |
| 63 | } |
| 64 | shell.calls = calls |
| 65 | return shell |
| 66 | } |
| 67 | |
| 68 | async function withTempProject(files, fn) { |
| 69 | const projectDir = fs.mkdtempSync(path.join(os.tmpdir(), "ecc-opencode-plugin-")) |