Skip to content

Commit

Permalink
Merge pull request #1 from b-kelly/bkelly/lovejs-lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
poeck authored Sep 16, 2022
2 parents 459d34a + 013f3c6 commit 995ab22
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions src/targets/web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { IPaths, ITarget } from "../conf/targets";
import { exec } from "child_process";
import { join } from "path";
import { zip } from "zip-a-folder";
import { platform } from "os";
import * as fse from "fs-extra";

export default async function packageLove(
Expand All @@ -13,19 +12,11 @@ export default async function packageLove(
const unpackedDir = join(paths.tmp, "web-unpacked");
fse.emptydirSync(unpackedDir);

const nodeModulesPath = await new Promise<string>((res, rej) => {
exec(`cd ${__dirname} && npm root`, (err, data) => {
if (err) return rej(err);
res(data.replace("\n", "").replace("\r", ""));
});
});

const loveJsName = platform() == "win32" ? "love.js.cmd" : "love.js";
const loveJsPath = join(nodeModulesPath, ".bin", loveJsName);
const loveJsPath = require.resolve("love.js");

await new Promise((res, rej) => {
exec(
`${loveJsPath} ${paths.tmpLove} ${unpackedDir} -t "${config.name}" -c`,
`node ${loveJsPath} ${paths.tmpLove} ${unpackedDir} -t "${config.name}" -c`,
(err) => {
if (err) return rej(err);
res(null);
Expand Down

0 comments on commit 995ab22

Please sign in to comment.