Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

844 B
Raw Blame
import type { Command } from 'commander'
import { railsCommand } from '../backend.js'
import { detectProject } from '../context.js'
import { warnDeprecated } from '../deprecation.js'
import { dockerComposeExecOrRun } from '../docker.js'

// Deprecated: Rails-only, so it goes through the `spree exec` escape hatch.
export function registerRailsCommand(program: Command): void {
  program
    .command('rails', { hidden: true })
    .description('Deprecated: use `spree exec bin/rails …`')
    .argument('<args...>', 'arguments to pass to bin/rails')
    .allowUnknownOption(true)
    .passThroughOptions(true)
    .action(async (args: string[]) => {
      warnDeprecated('spree rails', `spree exec bin/rails ${args.join(' ')}`)
      const ctx = detectProject()
      await dockerComposeExecOrRun(railsCommand(args), ctx.projectDir)
    })
}