diff --git a/bin/README.md b/bin/README.md index e7cd21e14..d0dcbc702 100644 --- a/bin/README.md +++ b/bin/README.md @@ -211,12 +211,12 @@ Specify the system tray icon. This is only effective when the system tray is ena --system-tray-icon ``` -#### [iter-copy-file] +#### [use-local-file] Enable recursive copying. When the URL is a local file path, enabling this option will copy the folder containing the file specified in the URL, as well as all sub-files, to the Pake static folder. This is disabled by default. ```shell ---iter-copy-file +--use-local-file ``` #### [inject] diff --git a/bin/README_CN.md b/bin/README_CN.md index 5a0dc0829..3e9ae7089 100644 --- a/bin/README_CN.md +++ b/bin/README_CN.md @@ -212,14 +212,14 @@ Linux,默认为 `all`。 --system-tray-icon ``` -#### [iter-copy-file] +#### [use-local-file] 当 `url` 为本地文件路径时,如果启用此选项,则会递归地将 `url` 路径文件所在的文件夹及其所有子文件复 制到 Pake 的静态文件夹。默认不启用。 ```shell ---iter-copy-file +--use-local-file ``` #### [inject] diff --git a/bin/cli.ts b/bin/cli.ts index be4b2f6ad..2037b439b 100644 --- a/bin/cli.ts +++ b/bin/cli.ts @@ -29,17 +29,18 @@ program .option('--icon ', 'Application icon', DEFAULT.icon) .option('--width ', 'Window width', validateNumberInput, DEFAULT.width) .option('--height ', 'Window height', validateNumberInput, DEFAULT.height) + .option('--use-local-file', 'Use local file packaging', DEFAULT.useLocalFile) .option('--fullscreen', 'Start in full screen', DEFAULT.fullscreen) .option('--hide-title-bar', 'Only for Mac, hide title bar', DEFAULT.hideTitleBar) .option('--activation-shortcut ', 'Shortcut key to active App', DEFAULT.activationShortcut) .option('--multi-arch', 'Only for Mac, supports both Intel and M1', DEFAULT.multiArch) .option('--inject [injects...]', 'Injection of .js or .css Files', DEFAULT.inject) - .option('--safe-domain [domains...]', 'Domains that Require Security Configuration"', DEFAULT.safeDomain) .option('--debug', 'Debug build and more output', DEFAULT.debug) .addOption(new Option('--user-agent ', 'Custom user agent').default(DEFAULT.userAgent).hideHelp()) .addOption(new Option('--targets ', 'Only for Linux, option "deb" or "appimage"').default(DEFAULT.targets).hideHelp()) .addOption(new Option('--always-on-top', 'Always on the top level').default(DEFAULT.alwaysOnTop).hideHelp()) .addOption(new Option('--disabled-web-shortcuts', 'Disabled webPage shortcuts').default(DEFAULT.disabledWebShortcuts).hideHelp()) + .addOption(new Option('--safe-domain [domains...]', 'Domains that Require Security Configuration').default(DEFAULT.safeDomain).hideHelp()) .addOption(new Option('--show-system-tray', 'Show system tray in app').default(DEFAULT.showSystemTray).hideHelp()) .addOption(new Option('--system-tray-icon ', 'Custom system tray icon').default(DEFAULT.systemTrayIcon).hideHelp()) .version(packageJson.version, '-v, --version', 'Output the current version') diff --git a/bin/defaults.ts b/bin/defaults.ts index ef356da53..564b2f11d 100644 --- a/bin/defaults.ts +++ b/bin/defaults.ts @@ -14,7 +14,7 @@ export const DEFAULT_PAKE_OPTIONS: PakeCliOptions = { showSystemTray: false, multiArch: false, targets: 'deb', - iterCopyFile: false, + useLocalFile: false, systemTrayIcon: '', debug: false, inject: [], diff --git a/bin/helpers/merge.ts b/bin/helpers/merge.ts index e1a30e68f..482aa20c3 100644 --- a/bin/helpers/merge.ts +++ b/bin/helpers/merge.ts @@ -19,7 +19,7 @@ export async function mergeConfig(url: string, options: PakeAppOptions, tauriCon userAgent, showSystemTray, systemTrayIcon, - iterCopyFile, + useLocalFile, identifier, name, resizable = true, @@ -57,7 +57,7 @@ export async function mergeConfig(url: string, options: PakeAppOptions, tauriCon const distDir = path.join(npmDirectory, 'dist'); const distBakDir = path.join(npmDirectory, 'dist_bak'); - if (!iterCopyFile) { + if (!useLocalFile) { const urlPath = path.join(distDir, fileName); await fsExtra.copy(url, urlPath); } else { diff --git a/bin/types.ts b/bin/types.ts index f1eda575a..a1345933a 100644 --- a/bin/types.ts +++ b/bin/types.ts @@ -43,7 +43,7 @@ export interface PakeCliOptions { systemTrayIcon: string; // Recursive copy, when url is a local file path, if this option is enabled, the url path file and all its subfiles will be copied to the pake static file folder, default off - iterCopyFile: false; + useLocalFile: false; // Multi arch, supports both Intel and M1 chips, only for Mac multiArch: boolean; diff --git a/package.json b/package.json index 03a725632..bfd8baced 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pake-cli", - "version": "2.4.0", + "version": "2.5.0", "description": "🤱🏻 Turn any webpage into a desktop app with Rust. 🤱🏻 利用 Rust 轻松构建轻量级多端桌面应用。", "engines": { "node": ">=16.0.0"