this repo has no description

Remove cshell name convention

Changed files
+23 -8
src
bin
lib
+15
README.md
···
A shell session shim that makes exploring from the terminal a little bit easier.
+
## Up and running
+
+
To test shelter locally you feel need a ZFS pool, for now you must name it `shelter`.
+
+
```
+
$ truncate --size=10G /var/shelter.img
+
$ sudo zpool create shelter /var/shelter.img
+
$ sudo -E dune exec -- shelter
+
```
+
+
Sometimes you want to just restart the world.
+
+
```
+
$ sudo zpool destroy shelter && sudo zpool create shelter /var/shelter.img && sudo rm -rf ~/.cache/shelter
+
```
+5 -5
src/bin/main.ml
···
let home = Unix.getenv "HOME"
let state_dir fs type' =
-
let path = Eio.Path.(fs / home / ".cache/cshell" / type') in
+
let path = Eio.Path.(fs / home / ".cache/shelter" / type') in
Eio.Path.mkdirs ~exists_ok:true ~perm:0o755 path;
path
···
Eio_posix.run @@ fun env ->
Fmt_tty.setup_std_outputs ();
match Sys.argv.(1) with
-
| "shelter" ->
-
let dir = state_dir env#fs "shelter" in
-
Shelter.main env#fs env#clock env#process_mgr dir
-
| _ | (exception Invalid_argument _) ->
+
| "passthrough" ->
let dir = state_dir env#fs "passthrough" in
Pass.main env#fs env#clock env#process_mgr dir
+
| _ | (exception Invalid_argument _) ->
+
let dir = state_dir env#fs "shelter" in
+
Shelter.main env#fs env#clock env#process_mgr dir
+2 -2
src/lib/passthrough/shelter_passthrough.ml
···
let () = Fmt.set_style_renderer Format.str_formatter `Ansi_tty
let prompt _ _ =
-
Fmt.(styled (`Fg `Red) string) Format.str_formatter "cshell> ";
+
Fmt.(styled (`Fg `Red) string) Format.str_formatter "shelter-p> ";
Format.flush_str_formatter ()
let history_key = [ "history" ]
···
full_store),
() ) (Exec command) =
let info () =
-
S.Info.v ~message:"cshell" (Eio.Time.now clock |> Int64.of_float)
+
S.Info.v ~message:"shelter" (Eio.Time.now clock |> Int64.of_float)
in
let cmd =
String.split_on_char ' ' command
+1 -1
src/lib/shelter/shelter_main.ml
···
type ctx = Store.t
let init fs proc s =
-
let store = Store.init fs proc "test-pool" in
+
let store = Store.init fs proc "shelter" in
List.iter
(fun (_, { History.args; _ }) ->
LNoise.history_add (String.concat " " args) |> ignore)