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.
@@ -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
- // Basic semver check (only notifies if latest > current simply by string comparison or simple parsing)
25
- // Since it's x.y.z, simple comparison works for basic stuff, but a strict semver check is better.
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 https://periderm.dev/install.sh | bash`;
28
+ const updateCmd = isWin ? `npm install -g ${name}` : `curl -fsSL ${apiUrl}/install.sh | bash`;
29
29
  const box = `
30
30
  ╭──────────────────────────────────────────────────────────────╮
31
31
  │ │
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "periderm-cli",
3
- "version": "0.1.6",
3
+ "version": "0.1.7",
4
4
  "description": "A pre-launch checklist for your codebase.",
5
5
  "type": "module",
6
6
  "bin": {