resolvePath function implemented and tested, all green.

This commit is contained in:
2026-07-26 16:43:39 +02:00
parent 994b93ae47
commit cd08a4bf32
8 changed files with 302 additions and 7 deletions
+31
View File
@@ -0,0 +1,31 @@
import type { CommandDescriptor, CommandOutput } from "@core/command";
import type { ResultSuccess, ShellError } from "@core/result";
import type { ShellState } from "@core/shell_state";
import { createImmutableBuffer } from "@core/util/immutable_buffer";
export const COMMAND_NAME = "echo";
function main(state: ShellState, flags: string[], args: string[]): CommandOutput<ShellError> {
const joined = args.join(" ");
const encoded = new TextEncoder().encode(joined);
const stdout = createImmutableBuffer(encoded);
const result: ResultSuccess = {
type: "success",
exitCode: 0,
stdout,
stderr: createImmutableBuffer(new Uint8Array()),
commandName: COMMAND_NAME,
};
return {
state: state,
result,
};
}
export const descriptor: CommandDescriptor = {
fn: main,
name: COMMAND_NAME,
};