@snapcommit/cli 3.8.3 ā 3.8.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/index.js +27 -1
- package/package.json +1 -1
package/dist/repl/index.js
CHANGED
|
@@ -67,7 +67,14 @@ async function startREPL() {
|
|
|
67
67
|
});
|
|
68
68
|
rl.prompt();
|
|
69
69
|
rl.on('line', async (input) => {
|
|
70
|
-
|
|
70
|
+
let trimmed = input.trim();
|
|
71
|
+
// Strip "snap" prefix if user types it (they're already in snap!)
|
|
72
|
+
if (trimmed.startsWith('snap ')) {
|
|
73
|
+
trimmed = trimmed.substring(5).trim();
|
|
74
|
+
}
|
|
75
|
+
else if (trimmed.startsWith('snapcommit ')) {
|
|
76
|
+
trimmed = trimmed.substring(11).trim();
|
|
77
|
+
}
|
|
71
78
|
// Exit commands
|
|
72
79
|
if (trimmed === 'exit' || trimmed === 'quit' || trimmed === 'q') {
|
|
73
80
|
console.log(chalk_1.default.gray('\nš Great session! Keep building!\n'));
|
|
@@ -102,6 +109,25 @@ async function startREPL() {
|
|
|
102
109
|
rl.prompt();
|
|
103
110
|
return;
|
|
104
111
|
}
|
|
112
|
+
// GitHub commands
|
|
113
|
+
if (trimmed === 'github connect' || trimmed === 'connect github') {
|
|
114
|
+
const { githubConnectCommand } = await Promise.resolve().then(() => __importStar(require('../commands/github-connect')));
|
|
115
|
+
await githubConnectCommand();
|
|
116
|
+
rl.prompt();
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
if (trimmed === 'github status' || trimmed === 'github info') {
|
|
120
|
+
const { githubStatusCommand } = await Promise.resolve().then(() => __importStar(require('../commands/github-connect')));
|
|
121
|
+
await githubStatusCommand();
|
|
122
|
+
rl.prompt();
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
if (trimmed === 'github disconnect') {
|
|
126
|
+
const { githubDisconnectCommand } = await Promise.resolve().then(() => __importStar(require('../commands/github-connect')));
|
|
127
|
+
await githubDisconnectCommand();
|
|
128
|
+
rl.prompt();
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
105
131
|
// Switch repo by name or index
|
|
106
132
|
const switchRepoMatch = trimmed.match(/^(?:switch to|cd|goto) (.+)$/i);
|
|
107
133
|
if (switchRepoMatch) {
|