package dune-release

  1. Overview
  2. Docs

Safe OS operations.

All the commands in that module can have side-effects. They also all take a --dry-run paramater which cause the side-effect to be discarded and to display a message instead. Some of these commands also have a `--force` option: this causes the message to be printed AND the side-effects to be caused.

type error = Bos_setup.R.msg
val run : dry_run:bool -> ?force:bool -> ?sandbox:bool -> Bos.Cmd.t -> (unit, error) result
val run_io : dry_run:bool -> ?force:bool -> ?sandbox:bool -> default:'a -> Bos.Cmd.t -> Bos.OS.Cmd.run_in -> (Bos.OS.Cmd.run_out -> ('a, 'b) result) -> ('a, 'b) result
val run_out : dry_run:bool -> ?force:bool -> ?sandbox:bool -> ?err:Bos.OS.Cmd.run_err -> default:'a -> Bos.Cmd.t -> (Bos.OS.Cmd.run_out -> ('a, 'b) result) -> ('a, 'b) result
val delete_dir : dry_run:bool -> ?force:bool -> Fpath.t -> (unit, error) result
val delete_path : dry_run:bool -> Fpath.t -> (unit, error) result
val read_file : dry_run:bool -> Fpath.t -> (string, error) result
val write_file : dry_run:bool -> ?force:bool -> Fpath.t -> string -> (unit, error) result
val with_dir : dry_run:bool -> Fpath.t -> ('a -> 'b) -> 'a -> ('b, error) result
val file_exists : dry_run:bool -> Fpath.t -> (bool, error) result
val dir_exists : dry_run:bool -> Fpath.t -> (bool, error) result
val file_must_exist : dry_run:bool -> Fpath.t -> (Fpath.t, error) result
val out : 'a -> 'a * Bos.OS.Cmd.run_status