I’m stuck on Stage #ei0.
Here are my logs:
remote: ------------------------------------------------------------------------
remote:
remote:
remote: ___ _ ___ __ _
remote: / __\ ___ __| | ___ / __\_ __ __ _ / _|| |_ ___ _ __ ___
remote: / / / _ \ / _` | / _ \ / / | '__|/ _` || |_ | __|/ _ \| '__|/ __|
remote: / /___| (_) || (_| || __// /___| | | (_| || _|| |_| __/| | \__
remote: \____/ \___/ \__,_| \___|\____/|_| \__,_||_| \__|\___||_| |___/
remote:
remote:
remote: Welcome to CodeCrafters! Your commit was received successfully.
remote:
remote: ------------------------------------------------------------------------
remote:
remote: ⚡ This is a turbo test run. https://codecrafters.io/turbo
remote:
remote: Running tests on your code. Logs should appear shortly...
remote:
remote: [compile] Compiling codecrafters-shell v0.1.0 (/app)
remote: [compile] Finished `release` profile [optimized] target(s) in 1.22s
remote: [compile] Moved ./.codecrafters/run.sh → ./your_program.sh
remote: [compile] Compilation successful.
remote:
remote: Debug = true
remote:
remote: [tester::#EI0] Running tests for Stage #EI0 (Navigation - The pwd builtin)
remote: [tester::#EI0] Running ./your_program.sh
remote: [your-program] $ type pwd
remote: [your-program] pwd is a shell builtin
remote: [tester::#EI0] ✓ Received expected response
remote: [your-program] $ pwd
remote: [your-program] pwd: command not found
And here’s a snippet of my code:
let output = Command::new(command).args(args).output();
match output {
Ok(output) => {
if !output.stdout.is_empty() {
print!("{}", String::from_utf8_lossy(&output.stdout));
}
if !output.stderr.is_empty() {
eprint!("{}", String::from_utf8_lossy(&output.stderr));
}
}
Err(_err) => println!("{}: command not found", command),
}
}
}
I feel like this should (maybe it’s cheating) capture any command and correctly pass it to the shell. Indeed, I get this when running it locally:
vscode ➜ /workspaces/codecrafters-shell-rust (master) $ ./your_program.sh
Finished `release` profile [optimized] target(s) in 0.00s
$ type pwd
pwd is a shell builtin
$ pwd
/workspaces/codecrafters-shell-rust
$
So I’m a little confused how the output on the runner is different?
I made sure to push. Also, adding the debug flag seems to not have done anything?