Newest Commit - code same as last commit

This commit is contained in:
2026-02-06 17:32:49 +01:00
parent 7852a77a7c
commit ef09b642d6
64 changed files with 35 additions and 14 deletions

24
src/lib/stores/bash/bash.ts Normal file → Executable file
View File

@@ -65,6 +65,16 @@ export class Bash {
this.vfs = new VirtualFS({ fs: args.fs, user: args.user });
}
private _appendNewResult(inode: number, output: any, cmd: string) {
const data: PrintData = {
path: this.vfs.formatPath(this.vfs.getPathByInode(inode)),
output: output,
cmd: cmd
};
console.log(data);
this._terminal.PrintOutput(data);
}
updateHistory(input: string): void {
if ((this.user.history.length = 255)) {
this.user.history.unshift(...this.user.history.splice(-1));
@@ -107,14 +117,14 @@ export class Bash {
if (command.root) {
if (this.hasSudoPerms(this.user.uid)) {
let out: Result = command.method.call(this, args);
this.appendNewResult(this.getCwd(), out, this.user.history[0]);
this._appendNewResult(this.getCwd(), out, this.user.history[0]);
}
this.throwError(result);
}
let out: Result = command.method.call(this, args);
console.log(out);
this.appendNewResult(out.path, out.data?.data, this.user.history[0]);
this._appendNewResult(out.path, out.data?.data, this.user.history[0]);
}
throwError(result: Result): void {
@@ -134,16 +144,6 @@ export class Bash {
}
}
private appendNewResult(inode: number, output: any, cmd: string) {
const data: PrintData = {
path: this.vfs.formatPath(this.vfs.getPathByInode(inode)),
output: output,
cmd: cmd
};
console.log(data);
this._terminal.PrintOutput(data);
}
formatBytes(bytes: number, dPoint?: number, pow: 1024 | 1000 = 1024): string {
if (!+bytes) return '0';

0
src/lib/stores/bash/commands/cd.ts Normal file → Executable file
View File

0
src/lib/stores/bash/commands/ls.ts Normal file → Executable file
View File

0
src/lib/stores/bash/fs.ts Normal file → Executable file
View File

0
src/lib/stores/bash/sort.ts Normal file → Executable file
View File

0
src/lib/stores/bash/static.ts Normal file → Executable file
View File