try explicitly setting PATH
This commit is contained in:
parent
2e6bafb0f0
commit
4661516484
@ -18,9 +18,9 @@ const url = "/api/release";
|
|||||||
|
|
||||||
const payloadT = Type.Any();
|
const payloadT = Type.Any();
|
||||||
|
|
||||||
const repoPath = "./repo"; // path.resolve(__dirname, "..", "..", "..", "repo");
|
const repoPath = path.resolve(__dirname, "..", "..", "..", "repo");
|
||||||
const picoDirPath = "./pico8"; // path.resolve(__dirname, "..", "..", "..", "pico8");
|
const picoDirPath = path.resolve(__dirname, "..", "..", "..", "pico8");
|
||||||
const picoBinPath = "./pico8/pico8"; // path.resolve(picoDirPath, "pico8");
|
const picoBinPath = path.resolve(picoDirPath, "pico8");
|
||||||
|
|
||||||
// const {stdout, } = await execa(picoBinPath, ["/home/dylan/.lexaloffle/pico-8/carts/candles/candles.p8", "-export", path.join(__dirname, "result.js")]);
|
// const {stdout, } = await execa(picoBinPath, ["/home/dylan/.lexaloffle/pico-8/carts/candles/candles.p8", "-export", path.join(__dirname, "result.js")]);
|
||||||
// const {stdout, } = await execa("ls", ["-la", picoDirPath]);
|
// const {stdout, } = await execa("ls", ["-la", picoDirPath]);
|
||||||
@ -58,7 +58,7 @@ const handler = async ({payload}: FirRouteInput<typeof payloadT>) => {
|
|||||||
console.log("main exists: ", fs.existsSync(path.join(repoPath, manifest.main)));
|
console.log("main exists: ", fs.existsSync(path.join(repoPath, manifest.main)));
|
||||||
const {stdout} = await execa("ls", ["-la", picoDirPath], {shell: true});
|
const {stdout} = await execa("ls", ["-la", picoDirPath], {shell: true});
|
||||||
console.log(stdout);
|
console.log(stdout);
|
||||||
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.js")], {env: {PATH: "/app/pico8"}});
|
||||||
// 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");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user