periderm-cli 0.1.18 → 0.1.19
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 +14 -16
- package/package.json +1 -1
package/dist/update-notifier.js
CHANGED
|
@@ -3,6 +3,7 @@ import fs from "node:fs";
|
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
5
|
import { readConfig } from "./config.js";
|
|
6
|
+
import { PERIDERM_ASCII } from "./constants.js";
|
|
6
7
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
7
8
|
const pkgPath = path.join(__dirname, "..", "package.json");
|
|
8
9
|
export async function checkUpdate() {
|
|
@@ -27,22 +28,19 @@ export async function checkUpdate() {
|
|
|
27
28
|
const isUnix = process.platform !== "win32" && process.platform !== "android";
|
|
28
29
|
const npmCmd = isUnix ? `sudo npm install -g ${name}` : `npm install -g ${name}`;
|
|
29
30
|
const curlCmd = `curl -fsSL ${apiUrl}/install.sh | bash`;
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
╰${"─".repeat(width)}╯
|
|
44
|
-
`;
|
|
45
|
-
console.log(box);
|
|
31
|
+
const actualLogoLines = PERIDERM_ASCII.split("\n");
|
|
32
|
+
console.info("");
|
|
33
|
+
for (const line of actualLogoLines) {
|
|
34
|
+
console.info(chalk.hex("#FF4D00")(line));
|
|
35
|
+
}
|
|
36
|
+
console.info("");
|
|
37
|
+
console.info(chalk.bold.cyan("Update Available!"));
|
|
38
|
+
console.info(chalk.white("───────────────────────────────────"));
|
|
39
|
+
console.info(chalk.bold.green(`✓ New version: ${chalk.dim(currentVersion)} → ${chalk.green(latestVersion)}`));
|
|
40
|
+
console.info("");
|
|
41
|
+
console.info(chalk.bold.white("NPM : ") + chalk.cyan(npmCmd));
|
|
42
|
+
console.info(chalk.bold.white("Curl : ") + chalk.cyan(curlCmd));
|
|
43
|
+
console.info("");
|
|
46
44
|
}
|
|
47
45
|
}
|
|
48
46
|
catch (e) {
|