resolves #131 create output directory immediately (#167)

* resolves #131 create output directory immediately

Signed-off-by: tech4GT <varun.gupta1798@gmail.com>

* fix error if no steps are passed

Signed-off-by: tech4GT <varun.gupta1798@gmail.com>

* add exit message if steps not passed

Signed-off-by: tech4GT <varun.gupta1798@gmail.com>

* add test for creating output directory
This commit is contained in:
Varun Gupta
2018-02-07 03:12:22 +05:30
committed by Jeffrey Warren
parent c5dee8aef3
commit 32c5a29906
5 changed files with 45 additions and 5 deletions

21
src/CliUtils.js Normal file
View File

@@ -0,0 +1,21 @@
const fs = require('fs')
/*
* This function checks if the directory exists, if not it creates one on the given path
* Callback is called with argument error if an error is encountered
*/
function makedir(path,callback){
fs.access(path,function(err){
if(err) fs.mkdir(path,function(err){
if(err) callback(err);
callback();
});
else callback()
});
};
module.exports = exports = {
makedir: makedir
}