Hannes Mehnert
f7bc55f2e3
Only uploads with a single main binary invoke the hooks (since they use the main_binary)
17 lines
578 B
OCaml
17 lines
578 B
OCaml
let uname =
|
|
let cmd = Bos.Cmd.(v "uname" % "-s") in
|
|
lazy (match Bos.OS.Cmd.(run_out cmd |> out_string |> success) with
|
|
| Ok s when s = "FreeBSD" -> `FreeBSD
|
|
| Ok s when s = "Linux" -> `Linux
|
|
| Ok s -> invalid_arg (Printf.sprintf "OS %s not supported" s)
|
|
| Error (`Msg m) -> invalid_arg m)
|
|
|
|
let default_datadir =
|
|
match Lazy.force uname with
|
|
| `FreeBSD -> "/var/db/builder-web"
|
|
| `Linux -> "/var/lib/builder-web"
|
|
|
|
let default_configdir =
|
|
match Lazy.force uname with
|
|
| `FreeBSD -> "/usr/local/etc/builder-web"
|
|
| `Linux -> "/etc/builder-web"
|