Skip to content

Commit

Permalink
fix: Log the error message when the build fails.
Browse files Browse the repository at this point in the history
  • Loading branch information
shichen85 committed Nov 6, 2024
1 parent c53a586 commit c3cf78a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
5 changes: 3 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export async function run() {

if (save_logs) {
const logFile = path.resolve(
`${compiler.name}_${platform}_${config}_build.log`,
`${compiler.name}_${platform}_${config}_build.log`
);
fs.removeSync(logFile);
const writeStream = fs.createWriteStream(logFile);
Expand Down Expand Up @@ -75,7 +75,8 @@ export async function run() {
core.setOutput("out-name", outName);
core.setOutput("out-dir", outDir);
} catch (err) {
core.setFailed((err as Error).message);
core.error(err as Error);
core.setFailed(err as Error);
}
}

Expand Down
14 changes: 7 additions & 7 deletions src/lib/igor-build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export class Gms2Compile {
}
this.baseName = basename(this.projectDir, extname(this.projectDir)).replace(
" ",
"_",
"_"
);
this.exportPlatform = options.exportPlatform;
this.destinationDir = options.destinationDir || resolve("out");
Expand All @@ -101,15 +101,15 @@ export class Gms2Compile {
this.yyc = options.yyc;

this.localSettings = fs.readJSONSync(
join(this.userDir, "local_settings.json"),
join(this.userDir, "local_settings.json")
);

this.targetRuntime = this.localSettings["targetRuntime"];

this.runtimePath = //Infer the runtime path
join(
this.localSettings["runtimeDir"] as string,
`runtime-${this.targetRuntime}`,
`runtime-${this.targetRuntime}`
);
}

Expand Down Expand Up @@ -193,7 +193,7 @@ export class Gms2Compile {

private _generateWorkerCommands(
platform: ModuleAliases,
generatePublishBuild = false,
generatePublishBuild = false
) {
const worker = this._convertToIgorWorker(platform);

Expand Down Expand Up @@ -237,7 +237,7 @@ export class Gms2Compile {
baseCommand = join(
this.runtimePath,
`bin/igor/windows/${arch}`,
"Igor.exe",
"Igor.exe"
);
} else if (osPlatform() == "darwin") {
baseCommand = join(this.runtimePath, `bin/igor/osx/${arch}`, "Igor");
Expand Down Expand Up @@ -265,12 +265,12 @@ export class Gms2Compile {
`/runtime=${buildOptimization}`,
"/v",
"/ic",
"/cr",
"/cr"
);

if (fs.existsSync(legacyIgor)) {
args.push(
`/ssdk=${this.localSettings["machine.Platform Settings.Steam.steamsdk_path"]}`,
`/ssdk=${this.localSettings["machine.Platform Settings.Steam.steamsdk_path"]}`
);
}
const igorCommand = this._generateWorkerCommands(this.exportPlatform);
Expand Down

0 comments on commit c3cf78a

Please sign in to comment.