hide-on-close support param

This commit is contained in:
Tw93
2025-09-16 10:21:27 +08:00
parent 6aaa9a4517
commit f626ad5a0c
4 changed files with 19 additions and 2 deletions

View File

@@ -7,6 +7,7 @@ import { PakeAppOptions } from '@/types';
import { checkRustInstalled, installRust } from '@/helpers/rust';
import { mergeConfig } from '@/helpers/merge';
import tauriConfig from '@/helpers/tauriConfig';
import { generateIdentifierSafeName } from '@/utils/name';
import { npmDirectory } from '@/utils/dir';
import { getSpinner } from '@/utils/info';
import { shellExec } from '@/utils/shell';
@@ -409,7 +410,7 @@ export default abstract class BaseBuilder {
// Linux uses the unique binary name we set in merge.ts
if (process.platform === 'linux') {
return `pake-${appName.toLowerCase()}${extension}`;
return `pake-${generateIdentifierSafeName(appName)}${extension}`;
}
// Windows and macOS use 'pake' as binary name

8
bin/cli.ts vendored
View File

@@ -127,10 +127,16 @@ program
)
.addOption(
new Option(
'--hide-on-close',
'--hide-on-close [boolean]',
'Hide window on close instead of exiting (default: true for macOS, false for others)',
)
.default(DEFAULT.hideOnClose)
.argParser((value) => {
if (value === undefined) return true; // --hide-on-close without value
if (value === 'true') return true;
if (value === 'false') return false;
throw new Error('--hide-on-close must be true or false');
})
.hideHelp(),
)
.addOption(new Option('--title <string>', 'Window title').hideHelp())