mirror of
https://github.com/publiclab/image-sequencer.git
synced 2025-12-14 04:10:04 +01:00
* 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:
committed by
Jeffrey Warren
parent
c5dee8aef3
commit
32c5a29906
21
src/CliUtils.js
Normal file
21
src/CliUtils.js
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user