Module As_cmd

module As_cmd: sig .. end
Executing (non build) commands and IO operations.

For documentation see Assemblage.Cmd.



Command results


type 'a result = [ `Error of string | `Ok of 'a ] 
val ret : 'a -> 'a result
val error : string -> 'a result
val bind : 'a result -> ('a -> 'b result) -> 'b result
val map : 'a result -> ('a -> 'b) -> 'b result
val get : 'a result -> 'a
val on_error : ?level:As_log.level -> use:'a -> 'a result -> 'a
val ignore_error : use:'a -> 'a result -> 'a
val reword_error : ?replace:bool -> string -> 'a result -> 'a result
val exn_error : ?msg:(Printexc.raw_backtrace -> exn -> 'a -> string) ->
('a -> 'b) -> 'a -> 'b result
val (>>=) : 'a result -> ('a -> 'b result) -> 'b result
val (>>|) : 'a result -> ('a -> 'b) -> 'b result
module Infix: sig .. end

Path, files, directories and version control systems


type path = As_path.t 
module Path: sig .. end
module File: sig .. end
module Dir: sig .. end
module Vcs: sig .. end

Environment variable lookup


val env : string -> string option
val get_env : string -> string result

Executing commands


val exists : string -> bool result
val exec_ret : string -> string list -> int
val exec : string -> string list -> unit result
val read : ?trim:bool -> string -> string list -> string result
val read_lines : string -> string list -> string list result
val write : string -> string list -> As_path.t -> unit result