icoa-cli 2.19.38 → 2.19.39

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.
@@ -1,8 +1,14 @@
1
1
  import { readFileSync, writeFileSync, existsSync } from 'node:fs';
2
2
  import { join, dirname } from 'node:path';
3
3
  import { fileURLToPath } from 'node:url';
4
+ import { platform } from 'node:os';
4
5
  import chalk from 'chalk';
5
6
  import { getIcoaDir } from './config.js';
7
+ const installCmd = platform() === 'win32'
8
+ ? 'npm install -g icoa-cli@latest'
9
+ : platform() === 'darwin'
10
+ ? 'npm install -g icoa-cli@latest'
11
+ : 'sudo npm install -g icoa-cli@latest';
6
12
  const __dirname = dirname(fileURLToPath(import.meta.url));
7
13
  const SIX_HOURS_MS = 6 * 60 * 60 * 1000;
8
14
  function isNewer(latest, current) {
@@ -34,7 +40,7 @@ export function checkForUpdates() {
34
40
  if (cache.latestVersion && isNewer(cache.latestVersion, current)) {
35
41
  console.log(chalk.yellow(' \u2B06 Update available: ') +
36
42
  chalk.white('v' + current + ' \u2192 v' + cache.latestVersion) +
37
- chalk.gray(' Run: npm install -g icoa-cli@latest'));
43
+ chalk.gray(` Run: ${installCmd}`));
38
44
  }
39
45
  return;
40
46
  }
@@ -67,7 +73,7 @@ export function checkForUpdates() {
67
73
  if (isNewer(latest, current)) {
68
74
  console.log(chalk.yellow(' \u2B06 Update available: ') +
69
75
  chalk.white('v' + current + ' \u2192 v' + latest) +
70
- chalk.gray(' Run: npm install -g icoa-cli@latest'));
76
+ chalk.gray(` Run: ${installCmd}`));
71
77
  }
72
78
  }
73
79
  catch {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "icoa-cli",
3
- "version": "2.19.38",
3
+ "version": "2.19.39",
4
4
  "description": "ICOA CLI — The world's first CLI-native CTF competition terminal",
5
5
  "type": "module",
6
6
  "bin": {