CliSite/commands/append.ts

16 lines
399 B
TypeScript
Raw Normal View History

2022-06-12 09:38:38 +02:00
function append(args:Array<string>, curdir:any):string {
var buf = "";
if (args.length == 0) {
buf += "append: missing operand\n";
}
else {
if (curdir[args[0]] == undefined) {
curdir[args[0]] = "";
}
for (let i = 1; i < args.length; i++) {
curdir[args[0]] += args[i] + "\n";
}
}
return buf;
}
export { append };