bigass changes
- ls beginnings, - added groups to shellstate - made buffers optional in result factory functions, - made an enum signal map, - fixed a minor bug in path resolver that didnt output the '/' if the inode was at root (inode 0) from the moment it was called - added code that attaches the shell to the built-in IDE terminal -- tests need fixing, new code needs testing
This commit is contained in:
@@ -2,6 +2,7 @@ export interface ImmutableBuffer {
|
||||
readonly length: number;
|
||||
get(index: number): number;
|
||||
slice(start?: number, end?: number): ImmutableBuffer;
|
||||
byteSize(): number;
|
||||
toArray(): Uint8Array;
|
||||
}
|
||||
|
||||
@@ -22,10 +23,15 @@ export function createImmutableBuffer(input: Uint8Array): ImmutableBuffer {
|
||||
return Uint8Array.from(buffer);
|
||||
};
|
||||
|
||||
const byteSize = (): number => {
|
||||
return buffer.byteLength;
|
||||
};
|
||||
|
||||
const result: ImmutableBuffer = {
|
||||
length: buffer.length,
|
||||
get,
|
||||
slice,
|
||||
byteSize,
|
||||
toArray,
|
||||
};
|
||||
|
||||
|
||||
@@ -67,6 +67,11 @@ export function resolveInode(fs: FileSystem, inode: number): string {
|
||||
components.push(node.name);
|
||||
currentInode = node.parent;
|
||||
}
|
||||
if (components.length === 0) {
|
||||
components.push("/");
|
||||
return components.join("");
|
||||
}
|
||||
|
||||
components.reverse();
|
||||
components.unshift("");
|
||||
return components.join("/");
|
||||
|
||||
Reference in New Issue
Block a user