start some logging

This commit is contained in:
dylan 2024-03-26 01:04:57 -07:00
parent 9f2d67b13e
commit d6ae5a3ec0

View File

@ -45,15 +45,17 @@ const handler = async ({payload}: FirRouteInput<typeof payloadT>) => {
}); });
console.log("cloned"); console.log("cloned");
console.log("read local manifest"); console.log("read local manifest");
console.log("pico exists: ", fs.existsSync(picoBinPath));
console.log("main exists: ", 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")]);
await execa(picoBinPath, [path.join(repoPath, manifest.main), "-export", path.join(repoPath, "result.png")]); // 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 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"); // const png = Buffer.from(await fs.promises.readFile(path.join(repoPath, "result.png"))).toString("base64");
fs.promises.rm(repoPath, {recursive: true, force: true}); fs.promises.rm(repoPath, {recursive: true, force: true});
console.log({ console.log({
manifest, manifest,
js, js,
png, // png,
}); });
return true; return true;
}; };