Skip to content

Commit

Permalink
Fix new project not created if a non-empty folder with the same name …
Browse files Browse the repository at this point in the history
…as the boilerplate already exists in same directory
  • Loading branch information
anto-christo authored and jamesgeorge007 committed Feb 28, 2019
1 parent 89a9b29 commit dc8ee4b
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions lib/commands/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ const shell = require('shelljs');
const inquirer = require('inquirer');
const elegantSpinner = require('elegant-spinner');
const logUpdate = require('log-update');
const os = require('os');
const Table = require('cli-table');
const validate = require('validate-npm-package-name');
const { showBanner } = require('../external/banner');
Expand Down Expand Up @@ -67,7 +66,7 @@ let fetchTemplate = (template) => {
if (template !== 'basic') {
templateDir = `mevn-${template}-boilerplate`;
}
shell.exec(boilerplate[template], {silent: true}, {async: true});
shell.exec(`${boilerplate[template]} ${projectName}`, {silent: true}, {async: true});

let fetchSpinner = setInterval(() => {
logUpdate('Fetching the boilerplate ' + chalk.cyan.bold.dim(frame()));
Expand All @@ -81,9 +80,6 @@ let fetchTemplate = (template) => {

}, 5000);

let renameCmd = os.type() === 'Windows_NT' ? 'ren' : 'mv';
shell.exec(`${renameCmd} ${templateDir} ${projectName}`);

fs.writeFileSync(`./${projectName}/mevn.json`, projectConfig.join('\n').toString());

if (template === 'nuxt') {
Expand Down

0 comments on commit dc8ee4b

Please sign in to comment.