ccperm 1.3.0 → 1.3.1
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/cli.js +9 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -37,9 +37,17 @@ async function main() {
|
|
|
37
37
|
return;
|
|
38
38
|
}
|
|
39
39
|
if (args.includes('--update')) {
|
|
40
|
-
|
|
40
|
+
const before = (0, updater_js_1.getVersion)();
|
|
41
|
+
console.log(` Updating ccperm from ${colors_js_1.DIM}v${before}${colors_js_1.NC}...\n`);
|
|
41
42
|
try {
|
|
42
43
|
(0, node_child_process_1.execFileSync)('npm', ['install', '-g', 'ccperm@latest'], { stdio: 'inherit' });
|
|
44
|
+
const after = (0, node_child_process_1.execFileSync)('ccperm', ['-v'], { encoding: 'utf8' }).trim();
|
|
45
|
+
if (after === before) {
|
|
46
|
+
console.log(`\n ${colors_js_1.GREEN}✔ Already up to date. ${colors_js_1.BOLD}v${after}${colors_js_1.NC}`);
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
console.log(`\n ${colors_js_1.GREEN}✔ Updated! ${colors_js_1.DIM}v${before}${colors_js_1.NC} → ${colors_js_1.GREEN}${colors_js_1.BOLD}v${after}${colors_js_1.NC}`);
|
|
50
|
+
}
|
|
43
51
|
}
|
|
44
52
|
catch {
|
|
45
53
|
console.error(`\n ${colors_js_1.RED}Update failed. Try manually: npm install -g ccperm@latest${colors_js_1.NC}\n`);
|