struct
let noop = KEDSL.Program.sh "echo Nothing-done-here"
type t = {
tool_definition : Tool_def.t;
repository : string;
recursive : bool;
install_program : path: string -> KEDSL.Program.t;
init_program : path: string -> KEDSL.Program.t;
witness: host: KEDSL.Host.t -> path: string -> KEDSL.unknown_product;
}
let make ~repository
?(install_program = fun ~path -> noop)
?(init_program = fun ~path -> noop)
?(recursive = false)
~witness
tool_definition =
{tool_definition; repository; recursive; install_program; init_program; witness;}
let render ~run_program ~host ~install_tools_path tool =
let path =
install_tools_path // Tool_def.to_directory_name tool.tool_definition in
let ensure =
git_installation
~run_program ~host
~install_path:path
~install_program:(tool.install_program ~path)
~witness:(tool.witness ~host ~path)
~repository:tool.repository
~recursive:tool.recursive
tool.tool_definition
in
Machine.Tool.create tool.tool_definition ~ensure
~init:(tool.init_program path)
end