Add directory creation

This commit is contained in:
Pascal Le Merrer 2026-01-29 00:48:13 +01:00
parent c5176634c2
commit 4d3f604b59

View file

@ -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);
});
});