sig
module Vcs :
sig
type t = [ `Git | `Hg ]
val exists : Cmd.path -> t -> bool Cmd.result
val find : Cmd.path -> t option Cmd.result
val get : Cmd.path -> t Cmd.result
val head : ?dirty:bool -> Cmd.path -> t -> string Cmd.result
val describe : ?dirty:bool -> Cmd.path -> t -> string Cmd.result
val override_kind : unit -> t option
val set_override_kind : t option -> unit
val override_exec : unit -> string option
val set_override_exec : string option -> unit
end
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: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
val ( >>= ) : 'a result -> ('a -> 'b result) -> 'b result
val ( >>| ) : 'a result -> ('a -> 'b) -> 'b result
end
type path = Path.t
module Path :
sig
val exists : path -> bool result
val move : ?force:bool -> path -> path -> unit result
end
module File :
sig
val exists : path -> bool result
val dev_null : path
val delete : ?maybe:bool -> path -> unit result
val temp : string -> path result
val with_inf :
(in_channel -> 'a -> 'b result) -> path -> 'a -> 'b result
val read : path -> string result
val read_lines : path -> string list result
val with_outf :
(out_channel -> 'a -> 'b result) -> path -> 'a -> 'b result
val write : path -> string -> unit result
val write_lines : path -> string list -> unit result
val write_subst :
(string * string) list -> path -> string -> unit result
end
module Dir :
sig
val exists : path -> bool result
val getcwd : unit -> path result
val chdir : path -> unit result
val fold_files_rec :
?skip:string list ->
(string -> 'a -> 'a result) -> 'a -> string list -> 'a result
end
val env : string -> string option
val get_env : string -> string result
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 -> path -> unit result
end