Skip to content

Commit

Permalink
Create .serenata folder if needed on project setup
Browse files Browse the repository at this point in the history
References #460
  • Loading branch information
Gert-dev committed May 19, 2019
1 parent c8f6e31 commit 9481e68
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/ProjectManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
let ProjectManager;

const fs = require('fs');
const mkdirp = require('mkdirp');

module.exports =

Expand Down Expand Up @@ -45,7 +46,8 @@ module.exports =
* @param {String} mainFolder
*/
setUpProject(mainFolder) {
const configFilePath = mainFolder + '/.serenata/config.json';
const configFileFolderPath = mainFolder + '/.serenata';
const configFilePath = configFileFolderPath + '/config.json';

if (fs.existsSync(configFilePath)) {
throw new Error(
Expand All @@ -66,6 +68,7 @@ module.exports =
]
}`;

mkdirp.sync(configFileFolderPath);
fs.writeFileSync(configFilePath, template);
}

Expand Down

0 comments on commit 9481e68

Please sign in to comment.