Shells in OCaml
3
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fail early on CD

+5 -1
+5 -1
src/lib/eval.ml
··· 900 900 match path with 901 901 | Some p -> 902 902 let fp = Fpath.append cwd (Fpath.v p) in 903 - Exit.zero @@ S.set_cwd ctx.state fp 903 + if Eio.Path.is_directory (ctx.fs / Fpath.to_string fp) then 904 + Exit.zero @@ S.set_cwd ctx.state fp 905 + else 906 + Exit.nonzero_msg ~exit_code:1 ctx.state 907 + "cd: not a directory: %a" Fpath.pp fp 904 908 | None -> ( 905 909 match Eunix.find_env "HOME" with 906 910 | None -> Exit.nonzero_msg ctx.state "HOME not set"