Add worker.remove()

This commit is contained in:
jeromewu
2019-11-06 12:23:29 +00:00
parent fbdc691184
commit dbcb56b55c
2 changed files with 17 additions and 0 deletions

View File

@@ -80,6 +80,15 @@ const read = ({
res.resolve(Module.FS.readFile(path));
};
const remove = ({
payload: {
path,
},
}, res) => {
Module.FS.unlink(path);
res.resolve({ message: `Delete ${path}` });
};
const run = ({
payload: {
args,
@@ -108,6 +117,7 @@ exports.dispatchHandlers = (packet, send) => {
write,
transcode,
read,
remove,
run,
})[packet.action](packet, res);
} catch (err) {