unsable code rework, doesnt run
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import type { Permission, TimeStamps, User } from './bash';
|
||||
import type { Bash } from "./bash";
|
||||
import type { Permission, TimeStamps } from "./metadata";
|
||||
|
||||
export enum Type {
|
||||
Directory = 16384,
|
||||
@@ -14,7 +15,7 @@ export type NodePerms = {
|
||||
|
||||
export type FsInitArgs = {
|
||||
fs: any;
|
||||
user: User;
|
||||
bash: Bash;
|
||||
};
|
||||
|
||||
export type TreeNode = {
|
||||
@@ -37,6 +38,7 @@ export type TreeNode = {
|
||||
export class VirtualFS {
|
||||
private FsTable: Map<number, TreeNode>;
|
||||
private rootINode: number;
|
||||
private _Bash: Bash;
|
||||
|
||||
home: number;
|
||||
cwd: number;
|
||||
@@ -45,9 +47,10 @@ export class VirtualFS {
|
||||
constructor(args: FsInitArgs) {
|
||||
this.FsTable = args.fs;
|
||||
this.rootINode = 1;
|
||||
this.home = this._pathStringToINode(args.user.home);
|
||||
this.cwd = args.user.cwd ? args.user.cwd : this.home;
|
||||
this.pwd = args.user.pwd ? args.user.pwd : this.cwd;
|
||||
this._Bash = args.bash;
|
||||
this.home = this._pathStringToINode(args.bash.getUser().home);
|
||||
this.cwd = args.bash.getUser().cwd ? args.bash.getUser().cwd! : this.home;
|
||||
this.pwd = args.bash.getUser().pwd ? args.bash.getUser().pwd! : this.cwd;
|
||||
|
||||
console.log(this.home);
|
||||
console.log(this.cwd);
|
||||
|
||||
Reference in New Issue
Block a user