Skip to content

Commit

Permalink
Improves initialization of platform
Browse files Browse the repository at this point in the history
  • Loading branch information
kenorb committed Apr 20, 2024
1 parent 0ab40f8 commit bc35a55
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 6 deletions.
19 changes: 17 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23258,8 +23258,23 @@
: input.includePath;

if (input.initPlatform) {
const command = `"${mteExe}" /log:CON /portable ${
mte64Exe.length > 0
const configFilePath = `tester.ini`;
const mt64Exe =
glob.sync(Path.join(input.platformPath, '**', 'terminal64.exe'), {
nocase: true
})[0] || '';
const mt32Exe =
glob.sync(Path.join(input.platformPath, '**', 'terminal.exe'), {
nocase: true
})[0] || '';
const mtExe = mt64Exe || mt32Exe || '';
if (mtExe.length > 0) {
input.verbose && console.log(`MT path: "${mtExe}".`);
} else {
throw new Error(`Terminal cannot be found in "${input.platformPath}"!`);
}
const command = `"${mtExe}" /log:CON /portable ${
mt64Exe.length > 0
? `"/config:${configFilePath}"`
: `"${configFilePath}"`
}`;
Expand Down
22 changes: 18 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@ if (!isPost) {
try {
process.chdir(input.workingDirectory);

const configFilePath = `tester.ini`;
const mte64Exe =
glob.sync(Path.join(input.platformPath, '**', 'metaeditor64.exe'), {
nocase: true
Expand All @@ -77,7 +76,7 @@ if (!isPost) {
if (mteExe.length > 0) {
input.verbose && console.log(`MTE path: "${mteExe}".`);
} else {
throw new Error(`Platform cannot be found in "${input.platformPath}"!`);
throw new Error(`Compiler cannot be found in "${input.platformPath}"!`);
}

const includePath =
Expand All @@ -86,8 +85,23 @@ if (!isPost) {
: input.includePath;

if (input.initPlatform) {
const command = `"${mteExe}" /log:CON /portable ${
mte64Exe.length > 0
const configFilePath = `tester.ini`;
const mt64Exe =
glob.sync(Path.join(input.platformPath, '**', 'terminal64.exe'), {
nocase: true
})[0] || '';
const mt32Exe =
glob.sync(Path.join(input.platformPath, '**', 'terminal.exe'), {
nocase: true
})[0] || '';
const mtExe = mt64Exe || mt32Exe || '';
if (mtExe.length > 0) {
input.verbose && console.log(`MT path: "${mtExe}".`);
} else {
throw new Error(`Terminal cannot be found in "${input.platformPath}"!`);
}
const command = `"${mtExe}" /log:CON /portable ${
mt64Exe.length > 0
? `"/config:${configFilePath}"`
: `"${configFilePath}"`
}`;
Expand Down

0 comments on commit bc35a55

Please sign in to comment.