Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[opam init] warning during the initialization if it contains a compil…

…er directory with no initial .opam/config
  • Loading branch information...
commit 3d3b1779cb3c89417e738f3b1a075dd3090b0354 1 parent 4467173
@tuong tuong authored
Showing with 5 additions and 4 deletions.
  1. +5 −4 src/client.ml
View
9 src/client.ml
@@ -480,8 +480,6 @@ let init_ocaml alias ocaml_version =
let alias_p = Path.C.create alias in
let aliases = t.aliases in
- if not (Dirname.exists (Path.C.root alias_p)) then begin
-
Dirname.mkdir (Path.C.root alias_p);
add_alias t alias ocaml_version;
let t = load_state () in
@@ -544,7 +542,6 @@ let init_ocaml alias ocaml_version =
Dirname.rmdir (Path.C.root alias_p);
File.Aliases.write (Path.G.aliases t.global) aliases;
raise e
- end
let indent_left s nb =
let nb = nb - String.length s in
@@ -1193,7 +1190,11 @@ let init repo alias ocaml_version cores =
Dirname.mkdir (Path.G.descr_dir root);
Dirname.mkdir (Path.G.archive_dir root);
Dirname.mkdir (Path.G.compiler_dir root);
- init_ocaml alias ocaml_version;
+ let alias_p = Path.C.root (Path.C.create alias) in
+ if Dirname.exists alias_p then
+ Globals.warning "%s does not exist and %s already exist" (Filename.to_string config_f) (Dirname.to_string alias_p)
+ else
+ init_ocaml alias ocaml_version;
update ();
let t = update_available_current (load_state ()) in
let wish_install = Heuristic.get_packages t ocaml_version Heuristic.v_any in
Please sign in to comment.
Something went wrong with that request. Please try again.