package genspio

  1. Overview
  2. Docs
type command =
  1. | Raw of string
  2. | Comment of string
  3. | Redirect of {
    1. block : command list;
    2. stdout : compiled_value;
    }
  4. | If_then_else of {
    1. condition : string;
    2. block_then : command list;
    3. block_else : command list;
    }
  5. | While of {
    1. condition : string;
    2. block : command list;
    }
  6. | Sub_shell of command list
  7. | Make_directory of string
  8. | Pipe of {
    1. blocks : command list list;
    }
and compiled_value =
  1. | Unit
  2. | Literal_value of string
  3. | File of string
  4. | Tmp_file_in_variable of string
    (*

    File-path contained in variable.

    *)
  5. | Raw_inline of string
  6. | Octal_value_in_variable of string
type t = {
  1. commands : command list;
  2. result : compiled_value;
}
val to_argument : ?arithmetic:bool -> compiled_value -> string
val to_ascii : compiled_value -> string
val commands : t -> command list
val to_path_argument : compiled_value -> string
val pp_posix : Format.formatter -> t -> unit
val rawf : ('a, unit, string, command) format4 -> 'b
val cmtf : ('a, unit, string, command) format4 -> 'b
val make : command list -> compiled_value -> t
val unit : command list -> t
val literal_value : string -> t
val assert_unit : t -> unit
val redirect : stdout:t -> command list -> t
val mktmp : tmpdb:Tmp_db.t -> ?expression:'a -> ?script:'b -> string -> t
val with_tmp : tmpdb:Tmp_db.t -> ?expression:'a -> ?script:'b -> string -> (t -> command list) -> t
val if_then_else : t -> t -> t -> t
val bool_to_file : bool -> compiled_value -> command list
val bool_not : tmp:t -> t -> t
val return_value_to_bool : tmp:t -> t -> int -> t
val make_bool : condition:string -> tmp:t -> command list -> t
val while_loop : t -> t -> t
val sub_shell : pre:command list -> command list -> t