cd fixed and cleaned up. Shell started, needs data fetching code to initialize properly, added the approperiate db_manager file to implement that.
This commit is contained in:
+20
-24
@@ -32,30 +32,26 @@ function main(state: ShellState, __flags: string[], args: string[]): CommandOutp
|
||||
let inode: number;
|
||||
const session = getCurrentSession(state);
|
||||
|
||||
switch (args[0]) {
|
||||
case undefined:
|
||||
inode = session.user.home;
|
||||
break;
|
||||
case "-":
|
||||
inode = session.pwd;
|
||||
break;
|
||||
default:
|
||||
const result = safeResolvePath(state.filesystem, session.cwd, args[0]);
|
||||
if (result.type === "error") {
|
||||
return {
|
||||
state,
|
||||
result: createErrorResult(
|
||||
"PathResolutionError",
|
||||
"No such file or directory",
|
||||
{ path: args[0]! },
|
||||
createImmutableBuffer(new Uint8Array()),
|
||||
createImmutableBuffer(new Uint8Array()),
|
||||
COMMAND_NAME,
|
||||
),
|
||||
} satisfies CommandOutput<PathResolutionError>;
|
||||
}
|
||||
inode = result.inode;
|
||||
break;
|
||||
if (args[0] === undefined) {
|
||||
inode = session.user.home;
|
||||
} else if (args[0] === "-") {
|
||||
inode = session.pwd;
|
||||
} else {
|
||||
const result = safeResolvePath(state.filesystem, session.cwd, args[0]);
|
||||
if (result.type === "error") {
|
||||
return {
|
||||
state,
|
||||
result: createErrorResult(
|
||||
"PathResolutionError",
|
||||
"No such file or directory",
|
||||
{ path: args[0]! },
|
||||
createImmutableBuffer(new Uint8Array()),
|
||||
createImmutableBuffer(new Uint8Array()),
|
||||
COMMAND_NAME,
|
||||
),
|
||||
} satisfies CommandOutput<PathResolutionError>;
|
||||
}
|
||||
inode = result.inode;
|
||||
}
|
||||
|
||||
if (state.filesystem.isFile(inode)) {
|
||||
|
||||
Reference in New Issue
Block a user