Skip to content

Commit

Permalink
🎨 Modify iterCopyFile to useLocalFile
Browse files Browse the repository at this point in the history
  • Loading branch information
tw93 committed May 9, 2024
1 parent 99c8167 commit 85b077a
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 10 deletions.
4 changes: 2 additions & 2 deletions bin/README.md
Expand Up @@ -211,12 +211,12 @@ Specify the system tray icon. This is only effective when the system tray is ena
--system-tray-icon <path>
```

#### [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]
Expand Down
4 changes: 2 additions & 2 deletions bin/README_CN.md
Expand Up @@ -212,14 +212,14 @@ Linux,默认为 `all`。
--system-tray-icon <path>
```

#### [iter-copy-file]
#### [use-local-file]

`url` 为本地文件路径时,如果启用此选项,则会递归地将 `url` 路径文件所在的文件夹及其所有子文件复

制到 Pake 的静态文件夹。默认不启用。

```shell
--iter-copy-file
--use-local-file
```

#### [inject]
Expand Down
3 changes: 2 additions & 1 deletion bin/cli.ts
Expand Up @@ -29,17 +29,18 @@ program
.option('--icon <string>', 'Application icon', DEFAULT.icon)
.option('--width <number>', 'Window width', validateNumberInput, DEFAULT.width)
.option('--height <number>', '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 <string>', '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 <string>', 'Custom user agent').default(DEFAULT.userAgent).hideHelp())
.addOption(new Option('--targets <string>', '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 <string>', 'Custom system tray icon').default(DEFAULT.systemTrayIcon).hideHelp())
.version(packageJson.version, '-v, --version', 'Output the current version')
Expand Down
2 changes: 1 addition & 1 deletion bin/defaults.ts
Expand Up @@ -14,7 +14,7 @@ export const DEFAULT_PAKE_OPTIONS: PakeCliOptions = {
showSystemTray: false,
multiArch: false,
targets: 'deb',
iterCopyFile: false,
useLocalFile: false,
systemTrayIcon: '',
debug: false,
inject: [],
Expand Down
4 changes: 2 additions & 2 deletions bin/helpers/merge.ts
Expand Up @@ -19,7 +19,7 @@ export async function mergeConfig(url: string, options: PakeAppOptions, tauriCon
userAgent,
showSystemTray,
systemTrayIcon,
iterCopyFile,
useLocalFile,
identifier,
name,
resizable = true,
Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion bin/types.ts
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion 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"
Expand Down

0 comments on commit 85b077a

Please sign in to comment.