Skip to content

Commit

Permalink
🔖 2.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
tw93 committed May 12, 2024
1 parent f660956 commit 166885a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
23 changes: 13 additions & 10 deletions dist/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import psl from 'psl';
import isUrl from 'is-url';

var name = "pake-cli";
var version = "2.5.0";
var version = "2.5.1";
var description = "🤱🏻 Turn any webpage into a desktop app with Rust. 🤱🏻 利用 Rust 轻松构建轻量级多端桌面应用。";
var engines = {
node: ">=16.0.0"
Expand Down Expand Up @@ -465,9 +465,11 @@ async function combineFiles(files, output) {
const contents = files.map(file => {
const fileContent = fs.readFileSync(file);
if (file.endsWith('.css')) {
return "window.addEventListener('DOMContentLoaded', (_event) => { const css = `" + fileContent + "`; const style = document.createElement('style'); style.innerHTML = css; document.head.appendChild(style); });";
return ("window.addEventListener('DOMContentLoaded', (_event) => { const css = `" +
fileContent +
"`; const style = document.createElement('style'); style.innerHTML = css; document.head.appendChild(style); });");
}
return "window.addEventListener('DOMContentLoaded', (_event) => { " + fileContent + " });";
return "window.addEventListener('DOMContentLoaded', (_event) => { " + fileContent + ' });';
});
fs.writeFileSync(output, contents.join('\n'));
return files;
Expand Down Expand Up @@ -633,7 +635,7 @@ async function mergeConfig(url, options, tauriConf) {
logger.error('The injected file must be in either CSS or JS format.');
return;
}
const files = inject.map(filepath => path.isAbsolute(filepath) ? filepath : path.join(process.cwd(), filepath));
const files = inject.map(filepath => (path.isAbsolute(filepath) ? filepath : path.join(process.cwd(), filepath)));
tauriConf.pake.inject = files;
await combineFiles(files, injectFilePath);
}
Expand Down Expand Up @@ -1014,10 +1016,7 @@ ${green('| |_) / _` | |/ / _ \\')}
${green('| __/ (_| | < __/')} ${yellow('https://github.com/tw93/pake')}
${green('|_| \\__,_|_|\\_\\___| can turn any webpage into a desktop app with Rust.')}
`;
program
.addHelpText('beforeAll', logo)
.usage(`[url] [options]`)
.showHelpAfterError();
program.addHelpText('beforeAll', logo).usage(`[url] [options]`).showHelpAfterError();
program
.argument('[url]', 'The web URL you want to package', validateUrlInput)
.option('--name <string>', 'Application name')
Expand All @@ -1034,8 +1033,12 @@ program
.addOption(new Option('--user-agent <string>', 'Custom user agent').default(DEFAULT_PAKE_OPTIONS.userAgent).hideHelp())
.addOption(new Option('--targets <string>', 'Only for Linux, option "deb" or "appimage"').default(DEFAULT_PAKE_OPTIONS.targets).hideHelp())
.addOption(new Option('--always-on-top', 'Always on the top level').default(DEFAULT_PAKE_OPTIONS.alwaysOnTop).hideHelp())
.addOption(new Option('--disabled-web-shortcuts', 'Disabled webPage shortcuts').default(DEFAULT_PAKE_OPTIONS.disabledWebShortcuts).hideHelp())
.addOption(new Option('--safe-domain [domains...]', 'Domains that Require Security Configuration').default(DEFAULT_PAKE_OPTIONS.safeDomain).hideHelp())
.addOption(new Option('--disabled-web-shortcuts', 'Disabled webPage shortcuts')
.default(DEFAULT_PAKE_OPTIONS.disabledWebShortcuts)
.hideHelp())
.addOption(new Option('--safe-domain [domains...]', 'Domains that Require Security Configuration')
.default(DEFAULT_PAKE_OPTIONS.safeDomain)
.hideHelp())
.addOption(new Option('--show-system-tray', 'Show system tray in app').default(DEFAULT_PAKE_OPTIONS.showSystemTray).hideHelp())
.addOption(new Option('--system-tray-icon <string>', 'Custom system tray icon').default(DEFAULT_PAKE_OPTIONS.systemTrayIcon).hideHelp())
.version(packageJson.version, '-v, --version', 'Output the current version')
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pake-cli",
"version": "2.5.0",
"version": "2.5.1",
"description": "🤱🏻 Turn any webpage into a desktop app with Rust. 🤱🏻 利用 Rust 轻松构建轻量级多端桌面应用。",
"engines": {
"node": ">=16.0.0"
Expand Down

0 comments on commit 166885a

Please sign in to comment.