kodingo-cli 1.0.14 → 1.0.15
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/commands/init.js +3 -4
- package/package.json +1 -1
package/dist/commands/init.js
CHANGED
|
@@ -113,7 +113,7 @@ function ensureGitignoreEntry(repoRoot, entry) {
|
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
115
|
// ── Browser login flow ────────────────────────────────────────────────────────
|
|
116
|
-
async function browserLogin() {
|
|
116
|
+
async function browserLogin(rl) {
|
|
117
117
|
// Request a state token from the API
|
|
118
118
|
const initRes = await fetch(`${API_BASE}/cli/auth/init`, { method: "POST" });
|
|
119
119
|
if (!initRes.ok)
|
|
@@ -122,8 +122,7 @@ async function browserLogin() {
|
|
|
122
122
|
console.log("\nPress Enter to open kodingo.xyz in your browser...");
|
|
123
123
|
console.log(`Or open this URL manually: ${loginUrl}\n`);
|
|
124
124
|
await new Promise(resolve => {
|
|
125
|
-
|
|
126
|
-
rl.question("", () => { rl.close(); resolve(); });
|
|
125
|
+
rl.question("", () => resolve());
|
|
127
126
|
});
|
|
128
127
|
// Open browser
|
|
129
128
|
try {
|
|
@@ -191,7 +190,7 @@ function registerInitCommand(program) {
|
|
|
191
190
|
}
|
|
192
191
|
else {
|
|
193
192
|
console.log("\nKodingo — Connect this repository\n");
|
|
194
|
-
const result = await browserLogin();
|
|
193
|
+
const result = await browserLogin(rl);
|
|
195
194
|
authToken = result.token;
|
|
196
195
|
email = result.email;
|
|
197
196
|
saveAuthToken(authToken, email);
|