@snapcommit/cli 3.8.8 ā 3.8.9
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/repl/index.js +15 -0
- package/package.json +1 -1
package/dist/repl/index.js
CHANGED
|
@@ -103,6 +103,21 @@ async function startREPL() {
|
|
|
103
103
|
rl.prompt();
|
|
104
104
|
return;
|
|
105
105
|
}
|
|
106
|
+
// Update command
|
|
107
|
+
if (trimmed === 'update' || trimmed === 'upgrade') {
|
|
108
|
+
console.log(chalk_1.default.cyan('\nš¦ Updating SnapCommit...\n'));
|
|
109
|
+
const { execSync } = await Promise.resolve().then(() => __importStar(require('child_process')));
|
|
110
|
+
try {
|
|
111
|
+
execSync('npm install -g @snapcommit/cli@latest', { stdio: 'inherit' });
|
|
112
|
+
console.log(chalk_1.default.green('\nā
Updated successfully!'));
|
|
113
|
+
console.log(chalk_1.default.yellow('ā ļø Please exit and restart snap to use the new version.\n'));
|
|
114
|
+
}
|
|
115
|
+
catch (error) {
|
|
116
|
+
console.log(chalk_1.default.red('\nā Update failed. Try manually: npm install -g @snapcommit/cli@latest\n'));
|
|
117
|
+
}
|
|
118
|
+
rl.prompt();
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
106
121
|
// Multi-repo commands
|
|
107
122
|
if (trimmed === 'repos' || trimmed === 'list repos' || trimmed === 'show repos') {
|
|
108
123
|
multiRepo.listRepos();
|