bikeshed-now 0.11.0 → 0.12.0

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.mjs +10 -15
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bikeshed-now",
3
- "version": "0.11.0",
3
+ "version": "0.12.0",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "description": "Publish and revise documents on a Bikeshed deployment from the terminal.",
package/src/index.mjs CHANGED
@@ -183,15 +183,9 @@ function isCi(value) {
183
183
 
184
184
  async function browserLogin(flags) {
185
185
  const interactive = Boolean(process.stdin.isTTY);
186
+ // Never asked: --origin, BIKESHED_ORIGIN, the last sign-in, then the default,
187
+ // the same order as every other command. The line below names it.
186
188
  let where = resolveAuth(flags).origin;
187
- if (interactive && !flags.origin) {
188
- const rl = createInterface({ input: process.stdin, output: process.stderr });
189
- try {
190
- where = (await rl.question(`Deployment [${where}]: `)).trim() || where;
191
- } finally {
192
- rl.close();
193
- }
194
- }
195
189
  try {
196
190
  const url = new URL(where);
197
191
  if (url.protocol !== "https:" && url.protocol !== "http:") throw new Error();
@@ -291,16 +285,17 @@ async function browserLogin(flags) {
291
285
  );
292
286
  }
293
287
 
294
- /** Paste a token made at /account. The flow from before browser sign-in. */
288
+ /**
289
+ * Paste a token made at /account. The flow from before browser sign-in.
290
+ *
291
+ * Only the token is read from stdin. Asking for the deployment first read a
292
+ * piped token as the address, and printed it back inside the /account link.
293
+ */
295
294
  async function pasteLogin(flags) {
296
- const { origin } = resolveAuth(flags);
295
+ const { origin: where } = resolveAuth(flags);
297
296
  const rl = createInterface({ input: process.stdin, output: process.stdout });
298
297
  try {
299
- const where =
300
- flags.origin ||
301
- (await rl.question(`Deployment [${origin}]: `)).trim() ||
302
- origin;
303
- console.log(`\nCreate a token at ${where}/account — choose "Command line".`);
298
+ console.log(`Create a token at ${where}/account — choose "Command line".`);
304
299
  console.log("It is shown once, so copy it now.\n");
305
300
  const token = (await rl.question("Token: ")).trim();
306
301
  if (!token) fail("no token given");