chapa-cli 0.2.1 → 0.2.2
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/index.js +13 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -330,14 +330,25 @@ async function login(serverUrl) {
|
|
|
330
330
|
console.log("Tip: If your default browser has your work (EMU) account,");
|
|
331
331
|
console.log(" use a different browser or an incognito/private window.\n");
|
|
332
332
|
console.log("Waiting for approval...");
|
|
333
|
+
let serverErrorLogged = false;
|
|
333
334
|
for (let i = 0; i < MAX_POLL_ATTEMPTS; i++) {
|
|
334
335
|
await sleep(POLL_INTERVAL_MS);
|
|
336
|
+
if (i > 0 && i % 5 === 0) {
|
|
337
|
+
process.stdout.write(".");
|
|
338
|
+
}
|
|
335
339
|
let data = null;
|
|
336
340
|
try {
|
|
337
341
|
const res = await fetch(
|
|
338
342
|
`${baseUrl}/api/cli/auth/poll?session=${sessionId}`
|
|
339
343
|
);
|
|
340
|
-
if (!res.ok)
|
|
344
|
+
if (!res.ok) {
|
|
345
|
+
if (!serverErrorLogged) {
|
|
346
|
+
console.error(`
|
|
347
|
+
Server returned ${res.status}. Retrying...`);
|
|
348
|
+
serverErrorLogged = true;
|
|
349
|
+
}
|
|
350
|
+
continue;
|
|
351
|
+
}
|
|
341
352
|
data = await res.json();
|
|
342
353
|
} catch {
|
|
343
354
|
continue;
|
|
@@ -363,7 +374,7 @@ Logged in as ${data.handle}!`);
|
|
|
363
374
|
}
|
|
364
375
|
|
|
365
376
|
// src/index.ts
|
|
366
|
-
var VERSION = true ? "0.2.
|
|
377
|
+
var VERSION = true ? "0.2.2" : "0.0.0-dev";
|
|
367
378
|
var HELP_TEXT = `chapa-cli v${VERSION}
|
|
368
379
|
|
|
369
380
|
Merge GitHub EMU (Enterprise Managed User) contributions into your Chapa badge.
|