🔀 merge dev
This commit is contained in:
43
bin/cli.ts
vendored
43
bin/cli.ts
vendored
@@ -13,17 +13,32 @@ program.version(packageJson.version).description('A command-line tool that can q
|
||||
|
||||
program
|
||||
.showHelpAfterError()
|
||||
.argument('[url]', 'the web URL you want to package', validateUrlInput)
|
||||
.option('-n, --name <string>', 'application name')
|
||||
.option('-i, --icon <string>', 'application icon', DEFAULT_PAKE_OPTIONS.icon)
|
||||
.option('-w, --width <number>', 'window width', validateNumberInput, DEFAULT_PAKE_OPTIONS.width)
|
||||
.option('-h, --height <number>', 'window height', validateNumberInput, DEFAULT_PAKE_OPTIONS.height)
|
||||
.option('-f, --fullscreen', 'start in full screen mode', DEFAULT_PAKE_OPTIONS.fullscreen)
|
||||
.option('-t, --transparent', 'transparent title bar', DEFAULT_PAKE_OPTIONS.transparent)
|
||||
.option('-r, --no-resizable', 'whether the window can be resizable', DEFAULT_PAKE_OPTIONS.resizable)
|
||||
.option('-d, --debug', 'debug', DEFAULT_PAKE_OPTIONS.debug)
|
||||
.option('-m, --multi-arch', "available for Mac only, and supports both Intel and M1", DEFAULT_PAKE_OPTIONS.multiArch)
|
||||
.option('--targets <string>', "Select the output package format, support deb/appimage/all, only for Linux", DEFAULT_PAKE_OPTIONS.targets)
|
||||
.argument('[url]', 'the web url you want to package', validateUrlInput)
|
||||
.option('--name <string>', 'application name')
|
||||
.option('--icon <string>', 'application icon', DEFAULT_PAKE_OPTIONS.icon)
|
||||
.option('--height <number>', 'window height', validateNumberInput, DEFAULT_PAKE_OPTIONS.height)
|
||||
.option('--width <number>', 'window width', validateNumberInput, DEFAULT_PAKE_OPTIONS.width)
|
||||
.option('--no-resizable', 'whether the window can be resizable', DEFAULT_PAKE_OPTIONS.resizable)
|
||||
.option('--fullscreen', 'makes the packaged app start in full screen', DEFAULT_PAKE_OPTIONS.fullscreen)
|
||||
.option('--transparent', 'transparent title bar', DEFAULT_PAKE_OPTIONS.transparent)
|
||||
.option('--user-agent <string>', 'custom user agent', DEFAULT_PAKE_OPTIONS.userAgent)
|
||||
.option('--show-menu', 'show menu in app', DEFAULT_PAKE_OPTIONS.showMenu)
|
||||
.option('--show-system-tray', 'show system tray in app', DEFAULT_PAKE_OPTIONS.showSystemTray)
|
||||
.option('--system-tray-icon <string>', 'custom system tray icon', DEFAULT_PAKE_OPTIONS.systemTrayIcon)
|
||||
.option('--iter-copy-file',
|
||||
'copy all static file to pake app when url is a local file',
|
||||
DEFAULT_PAKE_OPTIONS.iterCopyFile)
|
||||
.option(
|
||||
'-m, --multi-arch',
|
||||
"available for Mac only, and supports both Intel and M1",
|
||||
DEFAULT_PAKE_OPTIONS.multiArch
|
||||
)
|
||||
.option(
|
||||
'--targets <string>',
|
||||
'only for linux, default is "deb", option "appaimge" or "all"(deb & appimage)',
|
||||
DEFAULT_PAKE_OPTIONS.targets
|
||||
)
|
||||
.option('--debug', 'debug', DEFAULT_PAKE_OPTIONS.transparent)
|
||||
.action(async (url: string, options: PakeCliOptions) => {
|
||||
|
||||
await checkUpdateTips();
|
||||
@@ -40,10 +55,10 @@ program
|
||||
|
||||
const builder = BuilderFactory.create();
|
||||
await builder.prepare();
|
||||
|
||||
// logger.warn("you input url is ", url);
|
||||
const appOptions = await handleInputOptions(options, url);
|
||||
|
||||
await builder.build(url, appOptions);
|
||||
// logger.info(JSON.stringify(appOptions, null, 4));
|
||||
builder.build(url, appOptions);
|
||||
});
|
||||
|
||||
program.parse();
|
||||
|
||||
Reference in New Issue
Block a user