Fixed that cachedir should default to being relative to given datadir
This commit is contained in:
parent
1207ddbf70
commit
68849fecf3
2 changed files with 9 additions and 5 deletions
|
@ -11,9 +11,6 @@ let default_datadir =
|
|||
| `FreeBSD -> "/var/db/builder-web"
|
||||
| `Linux -> "/var/lib/builder-web"
|
||||
|
||||
let default_cachedir =
|
||||
default_datadir ^ "/_cache"
|
||||
|
||||
let default_configdir =
|
||||
match Lazy.force uname with
|
||||
| `FreeBSD -> "/usr/local/etc/builder-web"
|
||||
|
|
|
@ -81,7 +81,10 @@ let init_influx name data =
|
|||
let setup_app level influx port host datadir cachedir configdir =
|
||||
let dbpath = Printf.sprintf "%s/builder.sqlite3" datadir in
|
||||
let datadir = Fpath.v datadir in
|
||||
let cachedir = Fpath.v cachedir in
|
||||
let cachedir = match cachedir with
|
||||
| Some c -> Fpath.v c
|
||||
| None -> Fpath.(datadir / "_cache")
|
||||
in
|
||||
let configdir = Fpath.v configdir in
|
||||
let () = init_influx "builder-web" influx in
|
||||
match Builder_web.init dbpath datadir with
|
||||
|
@ -130,7 +133,11 @@ let datadir =
|
|||
|
||||
let cachedir =
|
||||
let doc = "cache directory" in
|
||||
Arg.(value & opt dir Builder_system.default_cachedir & info [ "cachedir" ] ~doc)
|
||||
Arg.(
|
||||
value
|
||||
& opt (some ~none:"DATADIR/_cache" dir) None
|
||||
& info [ "cachedir" ] ~doc
|
||||
)
|
||||
|
||||
let configdir =
|
||||
let doc = "config directory" in
|
||||
|
|
Loading…
Reference in a new issue