UNPKG

@mesh-tech/mesh-cli

Version:

CLI for Mesh platform development utilities

21 lines (20 loc) 746 B
import { logWarn } from './log.js'; export function resolveStackSelector(opts) { if (opts.stack != null) return { stack: opts.stack, usedDeprecatedStage: false }; if (opts.stage != null) return { stack: opts.stage, usedDeprecatedStage: true }; return { stack: undefined, usedDeprecatedStage: false }; } let warnedOnce = false; export function resetStackFlagWarning() { warnedOnce = false; } export function resolveStackOption(opts) { const { stack, usedDeprecatedStage } = resolveStackSelector(opts); if (usedDeprecatedStage && !warnedOnce) { warnedOnce = true; logWarn('--stage is deprecated; use --stack (the Pulumi-native name). --stage still works for now.'); } return stack; }