try shell: true

This commit is contained in:
dylan 2024-03-26 20:01:43 -07:00
parent 30faf61e5c
commit daea6ab912

View File

@ -56,7 +56,7 @@ const handler = async ({payload}: FirRouteInput<typeof payloadT>) => {
console.log("pico exists: ", fs.existsSync(picoBinPath));
console.log("manifest exists: ", fs.existsSync(path.join(repoPath, "picobook.json")));
console.log("main exists: ", fs.existsSync(path.join(repoPath, manifest.main)));
await execa(picoBinPath, [path.join(repoPath, manifest.main), "-export", path.join(repoPath, "result.js")]);
await execa(picoBinPath, [path.join(repoPath, manifest.main), "-export", path.join(repoPath, "result.js")], {shell: true});
// await execa(picoBinPath, [path.join(repoPath, manifest.main), "-export", path.join(repoPath, "result.png")]);
const js = await fs.promises.readFile(path.join(repoPath, "result.js"), "utf8");
// const png = Buffer.from(await fs.promises.readFile(path.join(repoPath, "result.png"))).toString("base64");