periderm-cli 0.1.6 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/update-notifier.js +4 -4
- package/package.json +1 -1
package/dist/update-notifier.js
CHANGED
|
@@ -2,6 +2,7 @@ import chalk from "chalk";
|
|
|
2
2
|
import fs from "node:fs";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
|
+
import { readConfig } from "./config.js";
|
|
5
6
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
6
7
|
const pkgPath = path.join(__dirname, "..", "package.json");
|
|
7
8
|
export async function checkUpdate() {
|
|
@@ -21,11 +22,10 @@ export async function checkUpdate() {
|
|
|
21
22
|
const data = await res.json();
|
|
22
23
|
const latestVersion = data.version;
|
|
23
24
|
if (latestVersion && latestVersion !== currentVersion) {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
// We will just check if they are not equal, since latest is usually higher.
|
|
25
|
+
const cfg = readConfig();
|
|
26
|
+
const apiUrl = cfg?.apiUrl || "https://periderm.dev";
|
|
27
27
|
const isWin = process.platform === "win32";
|
|
28
|
-
const updateCmd = isWin ? `npm install -g ${name}` : `curl -fsSL
|
|
28
|
+
const updateCmd = isWin ? `npm install -g ${name}` : `curl -fsSL ${apiUrl}/install.sh | bash`;
|
|
29
29
|
const box = `
|
|
30
30
|
╭──────────────────────────────────────────────────────────────╮
|
|
31
31
|
│ │
|