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.

739 B
Raw Blame
import * as p from '@clack/prompts'
import type { Command } from 'commander'
import { detectProject } from '../context.js'
import { appServices, dockerCompose } from '../docker.js'

export function registerRestartCommand(program: Command): void {
  program
    .command('restart')
    .description('Restart web + worker in place (does not apply compose changes)')
    .action(async () => {
      const ctx = detectProject()

      const s = p.spinner()
      s.start('Restarting web + worker...')
      try {
        await dockerCompose(['restart', ...(await appServices(ctx.projectDir))], ctx.projectDir)
        s.stop('Services restarted.')
      } catch (error) {
        s.stop('Restart failed.')
        throw error
      }
    })
}