package spin
OCaml project generator
Install
Dune Dependency
Authors
Maintainers
Sources
opam-spin-0.8.1.tbz
sha256=cd1ca43c7d3bb11be0b525642e57aa98e4d8250aea6c2fdb5c70b120449abdc1
sha512=0ff1e8886a49773d8ead3a21df1fb46697954fb43e875bd1ddc4cb95542fe0a767c556c432d78b47654a1f3d361800c234486e4cc237b9aa8d4df22e5a3a1ff9
doc/src/spin.std/spin_std.ml.html
Source file spin_std.ml
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
module Glob = Glob module Hashtbl = Hashtbl module List = List module Result = Result module String = String module Filename = Filename module Sys = Sys module Spawn = struct include Spawn let resolve_in_path prog = (* Do not try to resolve in the path if the program is something like * ./this.exe *) if String.split_on_char '/' prog |> List.length <> 1 then Some prog else let paths = Sys.getenv "PATH" |> String.split_on_char ':' in List.map (fun d -> Filename.concat d prog) paths |> List.find_opt Sys.file_exists let resolve_in_path_exn prog = match resolve_in_path prog with | None -> failwith (Printf.sprintf "no program in path %s" prog) | Some prog -> prog let spawn ?env ?cwd ?stdin ?stdout ?stderr prog argv = let prog = resolve_in_path_exn prog in let argv = prog :: argv in spawn ~prog ~argv ?env ?cwd ?stdin ?stdout ?stderr () let exec ?env ?cwd ?stdin ?stdout ?stderr prog argv = let pid = spawn ?env ?cwd ?stdin ?stdout ?stderr prog argv in match snd (Unix.waitpid [] pid) with | WEXITED 0 -> Ok () | WEXITED n -> Error (Printf.sprintf "exited with code %d" n) | WSIGNALED n -> Error (Printf.sprintf "exited with signal %d" n) | WSTOPPED n -> Error (Printf.sprintf "stopped with code %d" n) end
sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>