Skip to content

armgit / Pake

Public Imported from GitHub
0

Turn any website into a lightweight desktop app with one command, on macOS, Windows and Linux.

refactor: move update notification logic to cli.ts and remove redundant cli:dev script

Tw93d54c3c04afa3
diff --git a/bin/cli.ts b/bin/cli.ts
index 3bb296d0..69f42381 100644
--- a/bin/cli.ts
+++ b/bin/cli.ts
@@ -1,12 +1,19 @@
import log from 'loglevel';
+import updateNotifier from 'update-notifier';
+import packageJson from '../package.json';
import BuilderProvider from './builders/BuilderProvider';
-import { checkUpdateTips } from './helpers/updater';
import handleInputOptions from './options/index';
import { getCliProgram } from './helpers/cli-program';
import { PakeCliOptions } from './types';
const program = getCliProgram();
+async function checkUpdateTips() {
+ updateNotifier({ pkg: packageJson, updateCheckInterval: 1000 * 60 }).notify({
+ isGlobal: true,
+ });
+}
+
program.action(async (url: string, options: PakeCliOptions) => {
await checkUpdateTips();
diff --git a/bin/helpers/updater.ts b/bin/helpers/updater.ts
deleted file mode 100644
index bdb6bd74..00000000
--- a/bin/helpers/updater.ts
+++ /dev/null
@@ -1,8 +0,0 @@
-import updateNotifier from 'update-notifier';
-import packageJson from '../../package.json';
-
-export async function checkUpdateTips() {
- updateNotifier({ pkg: packageJson, updateCheckInterval: 1000 * 60 }).notify({
- isGlobal: true,
- });
-}
diff --git a/package.json b/package.json
index 2e8240e7..4681991f 100644
--- a/package.json
+++ b/package.json
@@ -38,7 +38,6 @@
"analyze": "cd src-tauri && cargo bloat --release --crates",
"tauri": "tauri",
"cli": "cross-env NODE_ENV=development rollup -c -w",
- "cli:dev": "cross-env NODE_ENV=development rollup -c -w",
"cli:build": "cross-env NODE_ENV=production rollup -c",
"test": "pnpm run cli:build && cross-env PAKE_CREATE_APP=1 node tests/index.js",
"format": "prettier --write . --ignore-unknown && find tests -name '*.js' -exec sed -i '' 's/[[:space:]]*$//' {} \\; && cd src-tauri && cargo fmt --verbose",