@anaella/cli 0.5.0 → 0.5.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 +8 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5,6 +5,9 @@ import { readFileSync as readFileSync3 } from "fs";
|
|
|
5
5
|
import { AnaellaClient } from "@anaella/client";
|
|
6
6
|
import { Command } from "commander";
|
|
7
7
|
|
|
8
|
+
// package.json
|
|
9
|
+
var version = "0.5.2";
|
|
10
|
+
|
|
8
11
|
// src/browser-login.ts
|
|
9
12
|
import { spawn } from "child_process";
|
|
10
13
|
import crypto from "crypto";
|
|
@@ -177,7 +180,10 @@ async function cmdDo(client, id, o) {
|
|
|
177
180
|
}
|
|
178
181
|
}
|
|
179
182
|
const job = await client.do(id, input);
|
|
180
|
-
|
|
183
|
+
const pending = job.status === "queued" || job.status === "running";
|
|
184
|
+
if (pending && o.wait) return client.waitForJob(job.id, { timeoutMs: 15 * 6e4 });
|
|
185
|
+
if (pending) console.error(`Running in the background: anaella job ${job.id} (or pass --wait)`);
|
|
186
|
+
return job;
|
|
181
187
|
}
|
|
182
188
|
|
|
183
189
|
// src/config.ts
|
|
@@ -278,7 +284,7 @@ var collect = (val, acc) => {
|
|
|
278
284
|
var program = new Command();
|
|
279
285
|
program.name("anaella").description(
|
|
280
286
|
"CLI for anaella.com \u2014 find and run tools, schedule and publish posts via the /v1 API."
|
|
281
|
-
).version(
|
|
287
|
+
).version(version).option("--api-key <key>", "ana_ API key (overrides env + config)").option("--api-url <url>", "API base URL").option("--json", "output raw JSON");
|
|
282
288
|
async function withClient(command, fn, columns) {
|
|
283
289
|
const opts = command.optsWithGlobals();
|
|
284
290
|
const cfg = resolveConfig({ apiKey: opts.apiKey, apiUrl: opts.apiUrl }, process.env);
|