package spin
OCaml project generator
Install
Dune Dependency
Authors
Maintainers
Sources
opam-spin-0.8.3.tbz
sha256=eeef9d3b89cca796d8d47ba425cee131bf14b5b0f1349927c4d8b22297b1f6b6
sha512=1850cad87f180b37e658e716986f6aa0ba76e57d6638d40b8f6e8ae2c6f60deee82218464e02356632022b394f49cc5a341e7255112aef455ffec9ca2db4cc32
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)"
>