package yocaml_git

  1. Overview
  2. Docs
Yocaml plugins for generating Yocaml program into a Git repository

Install

dune-project
 Dependency

Authors

Maintainers

Sources

yocaml-2.2.0.tbz
sha256=967db87e63b7da8c3f127df5461eb86d0da9d41ef20e1957beacec9df5ec760c
sha512=930d98d22f19232b498a399e86c88a8ec87d49886eaeb1c296ff48b6d7f1da6c420c53472028410ef83d1914e8268924636353378b5e99bf0e93783769519c9f

doc/yocaml_git/Yocaml_git/From_identity/argument-1-Source/index.html

Parameter From_identity.Source

type runtime_error

Runtime errors can be defined by the runtime creator.

type 'a t = 'a

Each command is wrapped in a value of type 'a t, making it possible to build runtimes wrapped in monads (for example, Git/Irmin, which are currently based on Lwt).

val runtime_error_to_string : runtime_error -> string

Converts a runtime error into a character string for diagnosis.

val bind : ('a -> 'b t) -> 'a t -> 'b t

the bind primitive for t.

val return : 'a -> 'a t

the return primitive for t.

val log : [ `App | `Error | `Warning | `Info | `Debug ] -> string -> unit t

log level message log a message with a given message.

val get_time : unit -> int t

get_time () returns the current timestamp.

val file_exists : on:[ `Source | `Target ] -> Yocaml.Path.t -> bool t

file_exists ~on:source -> path returns true if the file exists, false otherwise.

val read_file : on:[ `Source | `Target ] -> Yocaml.Path.t -> (string, runtime_error) result t

read_file ~on:source -> path returns the content of a file.

val get_mtime : on:[ `Source | `Target ] -> Yocaml.Path.t -> (int, runtime_error) result t

get_mtime ~on:source path returns the modification time of a file.

val hash_content : string -> string t

hash_content str hash a content.

val create_directory : on:[ `Source | `Target ] -> Yocaml.Path.t -> (unit, runtime_error) result t

create_directory ~on path create a directory.

val write_file : on:[ `Source | `Target ] -> Yocaml.Path.t -> string -> (unit, runtime_error) result t

write_file ~on:source path content write a file.

val is_directory : on:[ `Source | `Target ] -> Yocaml.Path.t -> bool t

is_directory ~on:source path returns true if the given path is a directory, false otherwise.

val read_dir : on:[ `Source | `Target ] -> Yocaml.Path.t -> (Yocaml.Path.fragment list, runtime_error) result t

read_dir ~on:source path returns a list of filename (fragment) of a given directory.

val exec : ?is_success:(int -> bool) -> string -> string list -> (string, runtime_error) result t

exec ?is_success prog ?args will executes prog ...args. When is_success is provided, it is called with the exit code to determine whether it indicates success or failure. Without is_success, success requires the process to return an exit code of 0.

printing on standard output is returned.