/* eslint-disable prefer-const */ import L from "../../utils/logger"; import execa from "execa"; import ora from "ora"; async function init(name: string): Promise { L.info(`initialize a new gatsby project: ${name}`); // create project with the starter const cmd = `npx gatsby new ${name} https://github.com/revtel/gatsby-starter#revtel`; L.info(`running following command:`); L.log(cmd); const spinner = ora("processing..."); try { spinner.start(); await execa.command(cmd); } finally { spinner.stop(); } L.success(`project created`); } export { init };