Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

export OPAMSWITCH only if using --switch=SWITCH

  • Loading branch information...
commit bee28af7c9b9efa76ecef603bbd0b0a1b1d8a837 1 parent 512be53
@samoht authored
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/client/opamState.ml
View
5 src/client/opamState.ml
@@ -909,7 +909,10 @@ let env_updates t =
let man_path =
"MANPATH", ":=", OpamFilename.Dir.to_string (OpamPath.Switch.man_dir t.root t.switch) in
let comp_env = OpamFile.Comp.env comp in
- let switch = [ "OPAMSWITCH", "=", OpamSwitch.to_string t.switch ] in
+ let switch = match !OpamGlobals.switch with
+ | `Command_line s -> [ "OPAMSWITCH", "=", s ]
+ | `Env _
+ | `Not_set -> [] in
let root =
if !OpamGlobals.root_dir <> OpamGlobals.default_opam_dir then
[ "OPAMROOT", "=", !OpamGlobals.root_dir ]
Please sign in to comment.
Something went wrong with that request. Please try again.