✨ Support two-word naming
This commit is contained in:
@@ -49,6 +49,9 @@ npm install -g pake-cli
|
|||||||
# Package a webpage
|
# Package a webpage
|
||||||
pake https://example.com --name MyApp --width 1200 --height 800
|
pake https://example.com --name MyApp --width 1200 --height 800
|
||||||
|
|
||||||
|
# Also supports names with spaces (cross-platform compatible)
|
||||||
|
# pake https://translate.google.com --name "Google Translate" --hide-title-bar
|
||||||
|
|
||||||
# Development with custom options
|
# Development with custom options
|
||||||
# Modify DEFAULT_DEV_PAKE_OPTIONS in bin/defaults.ts
|
# Modify DEFAULT_DEV_PAKE_OPTIONS in bin/defaults.ts
|
||||||
npm run cli:dev
|
npm run cli:dev
|
||||||
|
|||||||
9
bin/README.md
vendored
9
bin/README.md
vendored
@@ -62,8 +62,17 @@ Various options are available for customization. You can pass corresponding argu
|
|||||||
|
|
||||||
Specify the application name. If not provided, you will be prompted to enter it. It is recommended to use English.
|
Specify the application name. If not provided, you will be prompted to enter it. It is recommended to use English.
|
||||||
|
|
||||||
|
**Note**: Also supports multiple words with automatic platform-specific handling:
|
||||||
|
|
||||||
|
- **Windows/macOS**: Preserves spaces and case (e.g., `"Google Translate"`)
|
||||||
|
- **Linux**: Converts to lowercase with hyphens (e.g., `"google-translate"`)
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
--name <string>
|
--name <string>
|
||||||
|
--name MyApp
|
||||||
|
|
||||||
|
# Multiple words (if needed):
|
||||||
|
--name "Google Translate"
|
||||||
```
|
```
|
||||||
|
|
||||||
#### [icon]
|
#### [icon]
|
||||||
|
|||||||
11
bin/README_CN.md
vendored
11
bin/README_CN.md
vendored
@@ -60,10 +60,19 @@ pake [url] [options]
|
|||||||
|
|
||||||
#### [name]
|
#### [name]
|
||||||
|
|
||||||
指定应用程序的名称,如果在输入时未指定,系统会提示您输入,建议使用单个英文名称,不要出现下划线或者中文。
|
指定应用程序的名称,如果未指定,系统会提示您输入,建议使用英文单词。
|
||||||
|
|
||||||
|
**注意**: 也支持多个单词,会自动处理不同平台的命名规范:
|
||||||
|
|
||||||
|
- **Windows/macOS**: 保持空格和大小写(如 `"Google Translate"`)
|
||||||
|
- **Linux**: 转换为小写并用连字符连接(如 `"google-translate"`)
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
--name <string>
|
--name <string>
|
||||||
|
--name MyApp
|
||||||
|
|
||||||
|
# 多个单词(如需要):
|
||||||
|
--name "Google Translate"
|
||||||
```
|
```
|
||||||
|
|
||||||
#### [icon]
|
#### [icon]
|
||||||
|
|||||||
7
dist/cli.js
vendored
7
dist/cli.js
vendored
@@ -134,7 +134,8 @@ var windows = [
|
|||||||
always_on_top: false,
|
always_on_top: false,
|
||||||
dark_mode: false,
|
dark_mode: false,
|
||||||
activation_shortcut: "",
|
activation_shortcut: "",
|
||||||
disabled_web_shortcuts: false
|
disabled_web_shortcuts: false,
|
||||||
|
hide_on_close: false
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
var user_agent = {
|
var user_agent = {
|
||||||
@@ -147,7 +148,6 @@ var system_tray = {
|
|||||||
linux: true,
|
linux: true,
|
||||||
windows: true
|
windows: true
|
||||||
};
|
};
|
||||||
var hide_on_close = true;
|
|
||||||
var system_tray_path = "icons/icon.png";
|
var system_tray_path = "icons/icon.png";
|
||||||
var inject = [
|
var inject = [
|
||||||
];
|
];
|
||||||
@@ -156,7 +156,6 @@ var pakeConf = {
|
|||||||
windows: windows,
|
windows: windows,
|
||||||
user_agent: user_agent,
|
user_agent: user_agent,
|
||||||
system_tray: system_tray,
|
system_tray: system_tray,
|
||||||
hide_on_close: hide_on_close,
|
|
||||||
system_tray_path: system_tray_path,
|
system_tray_path: system_tray_path,
|
||||||
inject: inject,
|
inject: inject,
|
||||||
proxy_url: proxy_url
|
proxy_url: proxy_url
|
||||||
@@ -445,6 +444,7 @@ async function mergeConfig(url, options, tauriConf) {
|
|||||||
always_on_top: alwaysOnTop,
|
always_on_top: alwaysOnTop,
|
||||||
dark_mode: darkMode,
|
dark_mode: darkMode,
|
||||||
disabled_web_shortcuts: disabledWebShortcuts,
|
disabled_web_shortcuts: disabledWebShortcuts,
|
||||||
|
hide_on_close: hideOnClose,
|
||||||
};
|
};
|
||||||
Object.assign(tauriConf.pake.windows[0], { url, ...tauriConfWindowOptions });
|
Object.assign(tauriConf.pake.windows[0], { url, ...tauriConfWindowOptions });
|
||||||
tauriConf.productName = name;
|
tauriConf.productName = name;
|
||||||
@@ -490,7 +490,6 @@ async function mergeConfig(url, options, tauriConf) {
|
|||||||
tauriConf.pake.user_agent[currentPlatform] = userAgent;
|
tauriConf.pake.user_agent[currentPlatform] = userAgent;
|
||||||
}
|
}
|
||||||
tauriConf.pake.system_tray[currentPlatform] = showSystemTray;
|
tauriConf.pake.system_tray[currentPlatform] = showSystemTray;
|
||||||
tauriConf.pake.hide_on_close = hideOnClose;
|
|
||||||
// Processing targets are currently only open to Linux.
|
// Processing targets are currently only open to Linux.
|
||||||
if (platform === 'linux') {
|
if (platform === 'linux') {
|
||||||
delete tauriConf.bundle.linux.deb.files;
|
delete tauriConf.bundle.linux.deb.files;
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
"dark_mode": false,
|
"dark_mode": false,
|
||||||
"activation_shortcut": "",
|
"activation_shortcut": "",
|
||||||
"disabled_web_shortcuts": false,
|
"disabled_web_shortcuts": false,
|
||||||
"hide_on_close": false
|
"hide_on_close": true
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"user_agent": {
|
"user_agent": {
|
||||||
|
|||||||
Reference in New Issue
Block a user