diff --git a/src/wrapper.js b/src/wrapper.js index 6113039..bb117a3 100644 --- a/src/wrapper.js +++ b/src/wrapper.js @@ -219,3 +219,22 @@ app.ports.removeFile.subscribe(function (filePath) { }); }); + +// Create a directory +app.ports.createDirectory.subscribe(function (dirPath) { + fs.mkdir(dirPath) + .then((_) => { + getFileMetadata(dirPath, "").then((fileInfo)=>{ + app.ports.receiveCreatedDirectory.send(fileInfo); + }) + .catch((msg) => { + console.error(msg); + app.ports.receiveError.send(msg); + }); + + }) + .catch((msg) => { + console.error(msg); + app.ports.receiveError.send(msg); + }); +});