toolaby 1.0.0 → 1.0.1

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/bin.mjs +4 -3
  2. package/package.json +1 -1
package/bin.mjs CHANGED
@@ -24,10 +24,11 @@ import { spawn } from 'node:child_process';
24
24
  import { wireManifest, WORKER_LINES } from './lib/manifest.js';
25
25
  import { detectProject, CODE_FILES, filesToWrite } from './lib/project.js';
26
26
 
27
- const VERSION = '1.0.0';
27
+ const VERSION = '1.0.1';
28
28
  const CLIENT_ID = 'toolaby-cli';
29
29
  const argv = process.argv.slice(2);
30
- const command = argv.find((a) => !a.startsWith('--')) ?? 'help';
30
+ // `--version` and `--help` are commands of their own; every other command is the first bare word.
31
+ const command = argv.find((a) => ['--version', '-v', '--help', '-h'].includes(a)) ?? argv.find((a) => !a.startsWith('--')) ?? 'help';
31
32
  const rest = argv.filter((a) => a !== command);
32
33
  const positional = rest.filter((a) => !a.startsWith('--'));
33
34
  const opt = (k, d = null) => { const i = rest.indexOf(k); return i >= 0 && rest[i + 1] && !rest[i + 1].startsWith('--') ? rest[i + 1] : d; };
@@ -245,4 +246,4 @@ function help() {
245
246
  const commands = { login: async () => { await login(); }, logout, whoami, tools, wire, create, help, '--help': help, '-h': help, '--version': () => out(VERSION), '-v': () => out(VERSION) };
246
247
  const run = commands[command];
247
248
  if (!run) { console.error(`\n Unknown command "${command}".`); help(); process.exit(1); }
248
- run().catch((e) => fail(e.message));
249
+ Promise.resolve().then(run).catch((e) => fail(e.message));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "toolaby",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "The Toolaby command line: sign in once, then wire any Chrome extension to your tool on the Wall — sign-in, the Free plan, licences and subscriptions — or start a new one.",
5
5
  "type": "module",
6
6
  "bin": { "toolaby": "./bin.mjs" },