pacework 1.0.1 → 1.0.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/bin/pacework-runner-ctl.mjs +15 -2
- package/package.json +1 -1
|
@@ -243,6 +243,11 @@ function parseCliArgs(argv) {
|
|
|
243
243
|
const token = argv[i]
|
|
244
244
|
if (token.startsWith("--")) {
|
|
245
245
|
const key = token.slice(2)
|
|
246
|
+
if (key.includes("=")) {
|
|
247
|
+
const at = key.indexOf("=")
|
|
248
|
+
result[key.slice(0, at)] = key.slice(at + 1)
|
|
249
|
+
continue
|
|
250
|
+
}
|
|
246
251
|
const next = argv[i + 1]
|
|
247
252
|
if (next && !next.startsWith("--")) { result[key] = next; i++ }
|
|
248
253
|
else result[key] = "true"
|
|
@@ -312,7 +317,15 @@ if (!command || command === "--help" || command === "-h") {
|
|
|
312
317
|
|
|
313
318
|
if (command === "login") {
|
|
314
319
|
printBanner()
|
|
315
|
-
const
|
|
320
|
+
const savedUrl = readConfig().appUrl
|
|
321
|
+
let requestedUrl = parsedArgs["app-url"]
|
|
322
|
+
// A bare `login` (also what the menu runs) asks which server to use, so a
|
|
323
|
+
// saved URL, such as a local dev server, cannot pin every later login to it.
|
|
324
|
+
if (!requestedUrl && process.stdin.isTTY) {
|
|
325
|
+
requestedUrl = await promptLine(`pacework address [${savedUrl || "https://pacework.io"}]: `) || savedUrl
|
|
326
|
+
}
|
|
327
|
+
requestedUrl = String(requestedUrl || "https://pacework.io").trim().replace(/\/+$/, "")
|
|
328
|
+
const appUrl = /^https?:\/\//.test(requestedUrl) ? requestedUrl : `https://${requestedUrl}`
|
|
316
329
|
console.log("Opening browser for authentication…")
|
|
317
330
|
|
|
318
331
|
let token, loginUrl
|
|
@@ -1358,7 +1371,7 @@ else if (command === "menu") {
|
|
|
1358
1371
|
if (executorIndex < 0) return
|
|
1359
1372
|
await runChild(["use", EXECUTORS[executorIndex].id])
|
|
1360
1373
|
} },
|
|
1361
|
-
{ label: "Log in again / switch workspace", action: () => runChild(["login"]) },
|
|
1374
|
+
{ label: "Log in again / switch server or workspace", action: () => runChild(["login"]) },
|
|
1362
1375
|
{ label: "Log out", action: () => runChild(["logout"]) },
|
|
1363
1376
|
{ label: "Quit", action: null },
|
|
1364
1377
|
]
|