Skip to content

Commit

Permalink
fix(cli): getting platform value
Browse files Browse the repository at this point in the history
  • Loading branch information
mildronize committed May 6, 2024
1 parent b526a5c commit e3dcf26
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/main/src/command/build/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ export function getHostTarget(): TargetOptions {
debug?.(`Host Node.js Version: ${nodeVersion}`);

return {
platform: system.hostPlatform as TargetOptions['platform'],
platform: process.platform === 'win32' ? 'win' : process.platform === 'darwin' ? 'macos' : 'linux',
arch: system.hostArch as TargetOptions['arch'],
/**
* The pkg version 5.8.1 only support node.js version 18.x and below.
Expand Down Expand Up @@ -207,6 +207,7 @@ export async function buildExecutable(options: NammathamConfigs, result: BuildNo
} else {
targetOptions = target;
}
debug?.(`Building executable for target: ${targetOptions.runtime}-${targetOptions.platform}-${targetOptions.arch}`);
if (targetOptions.runtime === 'bun') {
throw new Error(`Conflict target build runtime: ${targetOptions.runtime} with ${options.runtime}`);
}
Expand Down

0 comments on commit e3dcf26

Please sign in to comment.