#!/usr/bin/env node
const { version }= require('./package.json');
const exec = require('child_process').exec
const  program = require('commander')

program
  .version(version)
  .command('start')
  .description('Start ArtiPub frontend server')
  .option('-h, --host <host>', 'host name', '127.0.0.1')
  .option('-p, --port <port>', 'port number', 8000)
  .action((options) => {
    const setUpCmd = `npx http-server ./dist -a ${options.host} -p ${options.port}`;

    // 开启前端服务
    console.log(setUpCmd)
    exec(setUpCmd, { shell: true })
  })

program.parse(process.argv)
