MCPcopy Create free account
hub / github.com/corrode/write-yourself-a-shell / run

Method run

examples/block5.rs:40–46  ·  view source on GitHub ↗

Run the `cd` command.

(self)

Source from the content-addressed store, hash-verified

38
39 /// Run the `cd` command.
40 pub fn run(self) -> Result<Option<Output>> {
41 // `std::env::set_current_dir` changes the current directory of the process
42 // (our shell in this case).
43 std::env::set_current_dir(&self.dir)?;
44 // The `cd` command doesn't produce any output.
45 Ok(None)
46 }
47 }
48
49 /// The `exit` command exits the shell.

Callers 1

mainFunction · 0.45

Calls 2

parseMethod · 0.45
run_externalMethod · 0.45

Tested by

no test coverage detected