From 6f38d0d5bd957475a3ad710a0a58a59b632ab09e Mon Sep 17 00:00:00 2001 From: Kate Date: Thu, 15 Aug 2024 12:24:14 +0100 Subject: [PATCH] Make the shell environment update hint easier to copy/paste --- master_changes.md | 1 + src/state/opamEnv.ml | 2 +- tests/reftests/env.unix.test | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/master_changes.md b/master_changes.md index debf725d1b4..c3583d1c2b4 100644 --- a/master_changes.md +++ b/master_changes.md @@ -74,6 +74,7 @@ users) ## Clean ## Env + * Make the shell environment update hint easier to copy/paste [#6159 @kit-ty-kate - fix #6158] ## Opamfile * Make all writes atomic [#5489 @kit-ty-kate] diff --git a/src/state/opamEnv.ml b/src/state/opamEnv.ml index 9b6e0990387..d3e76b6a225 100644 --- a/src/state/opamEnv.ml +++ b/src/state/opamEnv.ml @@ -1277,7 +1277,7 @@ let check_and_print_env_warning st = OpamStateConfig.(!r.switch_from <> `Command_line)) then OpamConsole.formatted_msg - "# Run %s to update the current shell environment\n" + "# To update the current shell environment, run: %s\n" (OpamConsole.colorise `bold (eval_string st.switch_global (Some st.switch))) diff --git a/tests/reftests/env.unix.test b/tests/reftests/env.unix.test index be7fdf29e00..4afdf07ee27 100644 --- a/tests/reftests/env.unix.test +++ b/tests/reftests/env.unix.test @@ -19,7 +19,7 @@ Switch invariant: ["nv"] <><> Processing actions <><><><><><><><><><><><><><><><><><><><><><><><><><><><> -> installed nv.1 Done. -# Run eval $(opam env '--root=${BASEDIR}/root 2' '--switch=${BASEDIR}/switch w spaces') to update the current shell environment +# To update the current shell environment, run: eval $(opam env '--root=${BASEDIR}/root 2' '--switch=${BASEDIR}/switch w spaces') ### opam env --root "$RT" --switch "./$SW" | grep "PREFIX" | ';' -> ':' OPAM_SWITCH_PREFIX='${BASEDIR}/switch w spaces/_opam': export OPAM_SWITCH_PREFIX: ### opam var root --root "$RT"