CliSite/commands/cat.js

24 lines
602 B
JavaScript
Raw Permalink Normal View History

2022-06-12 09:38:38 +02:00
"use strict";
exports.__esModule = true;
exports.cat = void 0;
function cat(args, curdir) {
var buf = "";
if (args.length == 0) {
buf += "cat: missing operand\n";
}
else {
var file = args[0];
if (curdir[file] == undefined) {
buf += "cat: " + file + ": No such file or directory\n";
}
else if (typeof curdir[file] == "string") {
buf += curdir[file] + "\n";
}
else {
buf += "cat: " + file + ": Is not a file\n";
}
}
return buf;
}
exports.cat = cat;
//# sourceMappingURL=cat.js.map