Merge pull request #188 from Cambalab/setup
Be sure to finnish write before script ends
This commit is contained in:
commit
efc8e61454
|
@ -200,12 +200,14 @@ if(!fs.existsSync('./\.env')) {
|
||||||
delete answers['password'];
|
delete answers['password'];
|
||||||
|
|
||||||
envfile.stringify(answers, function (err, str) {
|
envfile.stringify(answers, function (err, str) {
|
||||||
fs.outputFile('./\.env', str, function (fileErr) {
|
try {
|
||||||
if (fileErr) {
|
fs.outputFileSync('./\.env', str);
|
||||||
|
} catch (fileErr) {
|
||||||
return console.error(chalk.red(fileErr));
|
return console.error(chalk.red(fileErr));
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(chalk.green('Successfully created .env file'));
|
console.log(chalk.green('Successfully created .env file'));
|
||||||
});
|
|
||||||
user = new User({
|
user = new User({
|
||||||
firstName: 'Admin',
|
firstName: 'Admin',
|
||||||
lastName: 'Account',
|
lastName: 'Account',
|
||||||
|
@ -230,6 +232,7 @@ if(!fs.existsSync('./\.env')) {
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
console.log(chalk.green('Have fun using TellForm!'));
|
console.log(chalk.green('Have fun using TellForm!'));
|
||||||
|
process.exit(1);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue