Add directory creation
This commit is contained in:
parent
c5176634c2
commit
4d3f604b59
1 changed files with 19 additions and 0 deletions
|
|
@ -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);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue