@snapcommit/cli 1.1.3 ā 1.1.4
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.js +13 -0
- package/package.json +1 -1
package/dist/repl.js
CHANGED
|
@@ -189,6 +189,19 @@ async function startREPL() {
|
|
|
189
189
|
rl.prompt();
|
|
190
190
|
return;
|
|
191
191
|
}
|
|
192
|
+
// Detect npm/shell commands and provide helpful guidance
|
|
193
|
+
if (line.startsWith('npm ') || line.startsWith('yarn ') || line.startsWith('pnpm ')) {
|
|
194
|
+
console.log(chalk_1.default.yellow('\nš” You\'re inside the SnapCommit REPL!\n'));
|
|
195
|
+
if (line.includes('install') && line.includes('snapcommit')) {
|
|
196
|
+
console.log(chalk_1.default.white(' To update SnapCommit, just type: ') + chalk_1.default.cyan.bold('update\n'));
|
|
197
|
+
}
|
|
198
|
+
else {
|
|
199
|
+
console.log(chalk_1.default.white(' Shell commands don\'t work here.'));
|
|
200
|
+
console.log(chalk_1.default.gray(' Exit with ') + chalk_1.default.cyan('exit') + chalk_1.default.gray(' to run shell commands\n'));
|
|
201
|
+
}
|
|
202
|
+
rl.prompt();
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
192
205
|
if (line === 'help' || line === 'h') {
|
|
193
206
|
console.log(chalk_1.default.bold('\nš” SnapCommit Commands:\n'));
|
|
194
207
|
console.log(chalk_1.default.gray(' ⢠') + chalk_1.default.cyan('update') + chalk_1.default.gray(' - Update SnapCommit to latest version'));
|