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.

559 B
Raw Blame
import * as p from '@clack/prompts'
import type { Command } from 'commander'
import { SEED_TASK } from '../backend.js'
import { detectProject } from '../context.js'
import { captureTask } from '../docker.js'

export function registerSeedCommand(program: Command): void {
  program
    .command('seed')
    .description('Seed the database')
    .action(async () => {
      const ctx = detectProject()

      const s = p.spinner()
      s.start('Seeding database...')
      await captureTask(SEED_TASK, ctx.projectDir)
      s.stop('Database seeded.')
    })
}