app: fix sidecar args in release mode

This commit is contained in:
Tyler Wilding 2022-04-19 01:34:37 -04:00
parent 50774be9cf
commit dbbd549863
No known key found for this signature in database
GPG key ID: A89403EB356ED106
2 changed files with 12 additions and 19 deletions

View file

@ -52,6 +52,7 @@ jobs:
- uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
with:
tagName: v__VERSION__
releaseName: "OpenGOAL Launcher v__VERSION__"

View file

@ -17,17 +17,18 @@ export class RequirementStatus {
static Checking = Symbol("checking");
}
// TODO - is this set to `production` properly in release mode?
export function isInDebugMode() {
return process.env.NODE_ENV === "development";
}
// TODO - this is kind of a total hack
let debugPath;
let sidecarOptions = {};
if (isInDebugMode()) {
// TODO - this is kind of a total hack
let path = await resourceDir();
debugPath = path.split("launcher")[0].split("?\\")[1];
debugPath += "\\launcher\\bundle-test\\data";
sidecarOptions = { cwd: "bin" };
}
export async function isAVXSupported() {
@ -42,21 +43,18 @@ export async function isAVXSupported() {
}
export async function isOpenGLVersionSupported(version) {
// TODO - glewinfo not pre-compiled to work on linux yet!
if ((await os.platform()) === "darwin") {
return RequirementStatus.Unknown;
}
// Otherwise, query for the version
let command = Command.sidecar("bin/glewinfo", ["-version", version], {
cwd: "bin",
});
let command = Command.sidecar("bin/glewinfo", ["-version", version], sidecarOptions);
try {
let output = await command.execute();
if (output.code === 0) {
return RequirementStatus.Met;
}
return RequirementStatus.Failed;
} catch {
} catch (e) {
return RequirementStatus.Failed;
}
}
@ -71,15 +69,13 @@ export async function extractAndValidateISO(filePath) {
command = Command.sidecar(
"bin/extractor",
[filePath, "--extract", "--proj-path", debugPath],
{ cwd: "bin" }
sidecarOptions
);
} else {
command = Command.sidecar(
"bin/extractor",
[filePath, "--extract", "--validate"],
{
cwd: "bin",
}
sidecarOptions
);
}
@ -96,12 +92,10 @@ export async function decompileGameData(filePath) {
command = Command.sidecar(
"bin/extractor",
[filePath, "--decompile", "--proj-path", debugPath],
{ cwd: "bin" }
sidecarOptions
);
} else {
command = Command.sidecar("bin/extractor", [filePath, "--decompile"], {
cwd: "bin",
});
command = Command.sidecar("bin/extractor", [filePath, "--decompile"], sidecarOptions);
}
return await command.execute();
@ -117,12 +111,10 @@ export async function compileGame(filePath) {
command = Command.sidecar(
"bin/extractor",
[filePath, "--compile", "--proj-path", debugPath],
{ cwd: "bin" }
sidecarOptions
);
} else {
command = Command.sidecar("bin/extractor", [filePath, "--compile"], {
cwd: "bin",
});
command = Command.sidecar("bin/extractor", [filePath, "--compile"], sidecarOptions);
}
return await command.execute();