@elmundi/ship-cli 0.12.0 → 0.12.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.
package/README.md CHANGED
@@ -445,8 +445,8 @@ shipctl lanes install --yes
445
445
  shipctl lanes install --only pr-self-review,release-cut
446
446
 
447
447
  # wire to a specific shipctl version pin
448
- shipctl lanes install --shipctl-version 0.12.0 \
449
- --owner elmundi --repo ship --ref v0.12.0
448
+ shipctl lanes install --shipctl-version 0.12.1 \
449
+ --owner elmundi --repo ship --ref v0.12.1
450
450
 
451
451
  # inspect what's on disk vs config.yml
452
452
  shipctl lanes list --json
package/bin/shipctl.mjs CHANGED
@@ -24,6 +24,7 @@ if (raw[0] === "--version" || raw[0] === "-v" || raw[0] === "version") {
24
24
  const { _, ...g } = extractGlobalArgv(raw);
25
25
  const ctx = {
26
26
  baseUrl: g.baseUrl,
27
+ baseUrlSource: g.baseUrlSource,
27
28
  json: g.json,
28
29
  yes: g.yes,
29
30
  force: g.force,
@@ -123,7 +123,7 @@ EXIT
123
123
  */
124
124
  async function knowledgeInitCommand(ctx, args) {
125
125
  const opts = parseInitArgs(args);
126
- const baseUrl = resolveBaseUrl(opts.baseUrl || ctx.baseUrl);
126
+ const baseUrl = resolveBaseUrl(opts.baseUrl || explicitGlobalBaseUrl(ctx));
127
127
  const token = process.env.SHIP_API_TOKEN || "";
128
128
  if (!token) {
129
129
  console.error(
@@ -175,7 +175,7 @@ async function knowledgeInitCommand(ctx, args) {
175
175
 
176
176
  async function knowledgeFetchCommand(ctx, args) {
177
177
  const opts = parseFetchArgs(args);
178
- const baseUrl = resolveBaseUrl(opts.baseUrl || ctx.baseUrl);
178
+ const baseUrl = resolveBaseUrl(opts.baseUrl || explicitGlobalBaseUrl(ctx));
179
179
  const token = requireToken();
180
180
  let workspaceId = opts.workspace;
181
181
  if (!workspaceId) {
@@ -218,7 +218,7 @@ async function knowledgeFetchCommand(ctx, args) {
218
218
 
219
219
  async function knowledgeRefreshIntelCommand(ctx, args) {
220
220
  const opts = parseRefreshArgs(args);
221
- const baseUrl = resolveBaseUrl(opts.baseUrl || ctx.baseUrl);
221
+ const baseUrl = resolveBaseUrl(opts.baseUrl || explicitGlobalBaseUrl(ctx));
222
222
  const token = requireToken();
223
223
  let workspaceId = opts.workspace;
224
224
  if (!workspaceId) {
@@ -246,7 +246,7 @@ async function knowledgeRefreshIntelCommand(ctx, args) {
246
246
 
247
247
  async function knowledgeBootstrapCommand(ctx, args) {
248
248
  const opts = parseBootstrapArgs(args);
249
- const baseUrl = resolveBaseUrl(opts.baseUrl || ctx.baseUrl);
249
+ const baseUrl = resolveBaseUrl(opts.baseUrl || explicitGlobalBaseUrl(ctx));
250
250
  const token = requireToken();
251
251
  let workspaceId = opts.workspace;
252
252
  if (!workspaceId) {
@@ -278,6 +278,10 @@ async function knowledgeBootstrapCommand(ctx, args) {
278
278
  );
279
279
  }
280
280
 
281
+ function explicitGlobalBaseUrl(ctx) {
282
+ return ctx?.baseUrlSource === "flag" ? ctx.baseUrl : null;
283
+ }
284
+
281
285
  /**
282
286
  * @param {string[]} args
283
287
  * @returns {{
@@ -4,7 +4,7 @@ const VERSION = "v1";
4
4
 
5
5
  export async function triggerCommand(ctx, rest) {
6
6
  const opts = parseArgs(rest);
7
- const baseUrl = resolveBaseUrl(opts.baseUrl || ctx.baseUrl);
7
+ const baseUrl = resolveBaseUrl(opts.baseUrl || explicitGlobalBaseUrl(ctx));
8
8
  const token = requireToken();
9
9
  let workspaceId = opts.workspace;
10
10
  if (!workspaceId) workspaceId = await resolveSoleWorkspace(baseUrl, token);
@@ -40,6 +40,10 @@ export async function triggerCommand(ctx, rest) {
40
40
  for (const lane of due) console.log(` - ${lane.lane_id}`);
41
41
  }
42
42
 
43
+ function explicitGlobalBaseUrl(ctx) {
44
+ return ctx?.baseUrlSource === "flag" ? ctx.baseUrl : null;
45
+ }
46
+
43
47
  function printHelp() {
44
48
  console.log(`shipctl trigger — ask Ship which lanes are due (${VERSION})
45
49
 
package/lib/config.mjs CHANGED
@@ -8,6 +8,7 @@ export function extractGlobalArgv(argv) {
8
8
  baseUrl: (
9
9
  process.env.SHIP_API_BASE || "https://ship.elmundi.com/api/methodology"
10
10
  ).replace(/\/$/, ""),
11
+ baseUrlSource: process.env.SHIP_API_BASE ? "env" : "default",
11
12
  json: false,
12
13
  yes: false,
13
14
  force: false,
@@ -39,10 +40,12 @@ export function extractGlobalArgv(argv) {
39
40
  if (a === "--base-url" && copy[1]) {
40
41
  copy.shift();
41
42
  out.baseUrl = String(copy.shift()).replace(/\/$/, "");
43
+ out.baseUrlSource = "flag";
42
44
  continue;
43
45
  }
44
46
  if (a.startsWith("--base-url=")) {
45
47
  out.baseUrl = a.slice("--base-url=".length).replace(/\/$/, "");
48
+ out.baseUrlSource = "flag";
46
49
  copy.shift();
47
50
  continue;
48
51
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elmundi/ship-cli",
3
- "version": "0.12.0",
3
+ "version": "0.12.1",
4
4
  "type": "module",
5
5
  "description": "Ship CLI: bootstrap a repo, sync the Plays catalog, run Automations, report Runs.",
6
6
  "license": "Apache-2.0",