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'];
|
||||
|
||||
envfile.stringify(answers, function (err, str) {
|
||||
fs.outputFile('./\.env', str, function (fileErr) {
|
||||
if (fileErr) {
|
||||
try {
|
||||
fs.outputFileSync('./\.env', str);
|
||||
} catch (fileErr) {
|
||||
return console.error(chalk.red(fileErr));
|
||||
}
|
||||
|
||||
console.log(chalk.green('Successfully created .env file'));
|
||||
});
|
||||
|
||||
user = new User({
|
||||
firstName: 'Admin',
|
||||
lastName: 'Account',
|
||||
|
@ -230,6 +232,7 @@ if(!fs.existsSync('./\.env')) {
|
|||
});
|
||||
} else {
|
||||
console.log(chalk.green('Have fun using TellForm!'));
|
||||
process.exit(1);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue