From 4d3f604b599850a75377ee692767a3e289466a1d Mon Sep 17 00:00:00 2001 From: Pascal Le Merrer Date: Thu, 29 Jan 2026 00:48:13 +0100 Subject: [PATCH] Add directory creation --- src/wrapper.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) 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); + }); +});