Skip to content

Commit

Permalink
Display the correct eval string in opam init
Browse files Browse the repository at this point in the history
opam init knows what the shell is, so should use it, rather than
guessing eval $(opam env).
  • Loading branch information
dra27 committed Apr 2, 2018
1 parent 3d08110 commit 46eab70
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/state/opamEnv.ml
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,12 @@ let setup_interactive root ~dot_profile shell =
OpamConsole.msg "\n";

OpamConsole.header_msg "Required setup - please read";
let fake_gt =
{global_lock = OpamSystem.lock_none;
root;
config = OpamFile.Config.empty;
global_variables = OpamVariable.Map.empty}
in
OpamConsole.msg
"\n\
\ In normal operation, opam only alters files within ~/.opam.\n\
Expand All @@ -650,7 +656,7 @@ let setup_interactive root ~dot_profile shell =
(OpamConsole.colorise `bold @@ string_of_shell shell)
(OpamConsole.colorise `cyan @@ OpamFilename.prettify dot_profile)
(OpamConsole.colorise `bold @@ source root ~shell (init_file shell))
(OpamConsole.colorise `bold @@ "eval $(opam env)");
(OpamConsole.colorise `bold @@ eval_string shell fake_gt None);
match
OpamConsole.read
"Do you want opam to modify %s ? [N/y/f]\n\
Expand Down

0 comments on commit 46eab70

Please sign in to comment.