CliSite/commands/rm.js

21 lines
570 B
JavaScript
Raw Normal View History

2022-06-12 09:38:38 +02:00
"use strict";
exports.__esModule = true;
exports.rm = void 0;
function rm(args, curdir, socket) {
var buf = "";
if (curdir[socket.id][args[0]] != undefined) {
if (typeof curdir[socket.id][args[0]] == "string") {
delete curdir[socket.id][args[0]];
buf += "File " + args[0] + " removed\n";
}
else {
buf += "Error: " + args[0] + " is not a file\n";
}
}
else {
buf += "Error: " + args[0] + " does not exist\n";
}
return buf;
}
exports.rm = rm;
//# sourceMappingURL=rm.js.map