🐛 Fix name compatibility

This commit is contained in:
Tw93
2025-08-13 19:40:00 +08:00
parent 72652d814f
commit 09a122dd6b
5 changed files with 17 additions and 14 deletions

9
bin/cli.ts vendored
View File

@@ -31,14 +31,7 @@ program
// Refer to https://github.com/tj/commander.js#custom-option-processing, turn string array into a string connected with custom connectors.
// If the platform is Linux, use `-` as the connector, and convert all characters to lowercase.
// For example, Google Translate will become google-translate.
.option('--name <string...>', 'Application name', (value, previous) => {
const platform = process.platform;
const connector = platform === 'linux' ? '-' : ' ';
const name =
previous === undefined ? value : `${previous}${connector}${value}`;
return platform === 'linux' ? name.toLowerCase() : name;
})
.option('--name <string>', 'Application name')
.option('--icon <string>', 'Application icon', DEFAULT.icon)
.option(
'--width <number>',