Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correctly show config file locations when using a custom one #314

Merged
merged 2 commits into from
Oct 31, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* Generate a `*.xe` script which can upload a kernel to a XenServer.
* Generate a libvirt `*.xml` configuration file (#292).
* Fix determination of `mirage-xen` location for paths with spaces (#279).
* Correctly show config file locations when using a custom one.
* Fix generation of foreign (non-functor) modules (#293)

1.2.0 (2014-07-05):
Expand Down
15 changes: 10 additions & 5 deletions lib/mirage.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1771,6 +1771,11 @@ let reset () =
let set_config_file f =
config_file := Some f

let get_config_file () =
match !config_file with
| None -> Sys.getcwd () / "config.ml"
| Some f -> f

let update_path t root =
{ t with jobs = List.map (fun j -> Impl.update_path j root) t.jobs }

Expand Down Expand Up @@ -2167,7 +2172,7 @@ let clean_main t =
remove (t.root / "main.ml")

let configure t =
info "%s %s" (blue_s "Using configuration:") (t.root / "config.ml");
info "%s %s" (blue_s "Using configuration:") (get_config_file ());
info "%d job%s [%s]"
(List.length t.jobs)
(if List.length t.jobs = 1 then "" else "s")
Expand All @@ -2188,19 +2193,19 @@ let make () =
| _ -> "make"

let build t =
info "Build: %s" (blue_s (t.root / "config.ml"));
info "Build: %s" (blue_s (get_config_file ()));
in_dir t.root (fun () ->
command "%s build" (make ())
)

let run t =
info "Run: %s" (blue_s (t.root / "config.ml"));
info "Run: %s" (blue_s (get_config_file ()));
in_dir t.root (fun () ->
command "%s run" (make ())
)

let clean t =
info "Clean: %s" (blue_s (t.root / "config.ml"));
info "Clean: %s" (blue_s (get_config_file ()));
in_dir t.root (fun () ->
if !manage_opam then clean_opam t;
clean_myocamlbuild_ml t;
Expand Down Expand Up @@ -2245,7 +2250,7 @@ let scan_conf = function
info "%s %s" (blue_s "Using scanned config file:") f;
realpath f
| _ -> error "There is more than one config.ml in the current working directory.\n\
Please specify one explicitly on the command-line."
Please specify one explictly on the command-line."

let load file =
reset ();
Expand Down