package spin
OCaml project generator
Install
Dune Dependency
Authors
Maintainers
Sources
spin-0.8.0.tbz
sha256=2d612f7a55a2cd71177e96c6a5a5d3a7c258b19b4eef9cf994a24b1ec77c3764
sha512=1b46b047c6f3d3ed38ba38912680e2af802517f30d27ae42ceca4fa1b3954d28ba6922535a322230a57e466f009df499823b39a325f476a9bf938fa2e0cd8f4a
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)"
>