UNPKG

adastra-cli

Version:

Adastra CLI ✨ is a CLI toolkit built on top of Shopify CLI 3.X, this means that existing Adastra commands are the same as Shopify's. The goal from this package is to allow developers to use one CLI intefrace between the Vite and Shopify development server

25 lines (23 loc) 631 B
// src/utilities/command.ts import { Command } from "@oclif/core"; var BaseCommand = class extends Command { passThroughFlags(flags) { const passThroughFlags = []; for (const [label, value] of Object.entries(flags)) { if (typeof value === "boolean") { if (value) passThroughFlags.push(`--${label}`); } else if (Array.isArray(value)) { value.forEach( (element) => passThroughFlags.push(`--${label}`, `${element}`) ); } else { passThroughFlags.push(`--${label}`, `${value}`); } } return passThroughFlags; } }; export { BaseCommand };