@clickraft/cli 0.7.1 → 0.7.3

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 CHANGED
@@ -4513,6 +4513,13 @@ function exitCodeForResult(result) {
4513
4513
  }
4514
4514
  return 0;
4515
4515
  }
4516
+ function splitCsvArray(values) {
4517
+ if (!values || values.length === 0) return void 0;
4518
+ const result = values.flatMap(
4519
+ (v) => v.split(",").map((s) => s.trim()).filter(Boolean)
4520
+ );
4521
+ return result.length > 0 ? result : void 0;
4522
+ }
4516
4523
  async function runTemplateList(argv, ctx, rc) {
4517
4524
  const parsed = parseArgs(argv, {
4518
4525
  string: [...COMMON_RICH_STRING_FLAGS, "scope", "q", "cursor", "limit"],
@@ -4521,7 +4528,7 @@ async function runTemplateList(argv, ctx, rc) {
4521
4528
  });
4522
4529
  const result = await listTemplates({
4523
4530
  q: parsed.string.q,
4524
- tags: parsed.array.tags,
4531
+ tags: splitCsvArray(parsed.array.tags),
4525
4532
  scope: parsed.string.scope,
4526
4533
  cursor: parsed.string.cursor,
4527
4534
  limit: optionalInt(parsed.string.limit, "limit"),
@@ -4561,7 +4568,7 @@ async function runTemplateFind(argv, ctx, rc) {
4561
4568
  if (!query) throw new ArgError("Missing required <query> argument.");
4562
4569
  const result = await findTemplates({
4563
4570
  query,
4564
- tags: parsed.array.tags,
4571
+ tags: splitCsvArray(parsed.array.tags),
4565
4572
  scope: parsed.string.scope,
4566
4573
  cursor: parsed.string.cursor,
4567
4574
  limit: optionalInt(parsed.string.limit, "limit"),
@@ -4692,7 +4699,7 @@ async function runWorkflowCreate(argv, ctx, rc) {
4692
4699
  });
4693
4700
  let name = parsed.string.name;
4694
4701
  let description = parsed.string.description;
4695
- let tags = parsed.array.tags;
4702
+ let tags = splitCsvArray(parsed.array.tags);
4696
4703
  let declaredParams;
4697
4704
  if (parsed.string["from-file"]) {
4698
4705
  const raw = await readJsonFile(parsed.string["from-file"]);