Skip to content

Commit

Permalink
Return error codes for --run
Browse files Browse the repository at this point in the history
  • Loading branch information
RobDangerous committed Sep 24, 2024
1 parent 4e1b5a7 commit 14d8694
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 7 deletions.
20 changes: 17 additions & 3 deletions kmake/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -767,15 +767,29 @@ function compileProject(make: child_process.ChildProcess, project: Project, solu
if (options.run) {
if ((options.customTarget && options.customTarget.baseTarget === Platform.OSX) || options.target === Platform.OSX) {
const spawned = child_process.spawn('build/' + (options.debug ? 'Debug' : 'Release') + '/' + project.name + '.app/Contents/MacOS/' + project.name, {stdio: 'inherit', cwd: options.to});
spawned.on('close', () => { resolve(); });
spawned.on('close', (code: number) => {
if (code === 0) {
resolve();
}
else {
reject(code);
}
});
}
else if ((options.customTarget && (options.customTarget.baseTarget === Platform.Linux || options.customTarget.baseTarget === Platform.Windows)) || options.target === Platform.Linux || options.target === Platform.Windows) {
const spawned = child_process.spawn(path.resolve(options.from.toString(), project.getDebugDir(), executableName), [], {stdio: 'inherit', cwd: path.resolve(options.from.toString(), project.getDebugDir())});
spawned.on('close', () => { resolve(); });
spawned.on('close', (code: number) => {
if (code === 0) {
resolve();
}
else {
reject(code);
}
});
}
else {
log.info('--run not yet implemented for this platform');
resolve();
reject(1);
}
}
else {
Expand Down
20 changes: 17 additions & 3 deletions lib/kmake/main.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 14d8694

Please sign in to comment.