Skip to content

Commit

Permalink
Merge pull request #6159 from kit-ty-kate/copy-paste-opam-env
Browse files Browse the repository at this point in the history
Make the shell environment update hint easier to copy/paste
  • Loading branch information
kit-ty-kate authored Aug 19, 2024
2 parents 6fc00fd + 6f38d0d commit c2e7718
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions master_changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion src/state/opamEnv.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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)))

Expand Down
2 changes: 1 addition & 1 deletion tests/reftests/env.unix.test
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit c2e7718

Please sign in to comment.