@@ -18,7 +18,7 @@ User configuration:
1818### # we need the switch for variables file
1919### opam switch create fake --empty --root root
2020### sh locally-in-sh.sh sh -lc "sh -lc env" | grep MANPATH
21- MANPATH=:${BASEDIR}/root/fake/man:${BASEDIR}/root/fake/man
21+ MANPATH=:${BASEDIR}/root/fake/man
2222### ls root/opam-init | unordered
2323complete.sh
2424complete.zsh
@@ -73,29 +73,36 @@ if exist "${BASEDIR}/root/opam-init/variables.cmd" call "${BASEDIR}/root/opam-in
7373if Test-Path "${BASEDIR}/root/opam-init/variables.ps1" { . "${BASEDIR}/root/opam-init/variables.ps1" *> $null }
7474### : Variables scripts :
7575### cat root/opam-init/variables.sh | grep -v man | grep -v MANPATH
76+ test -z "$OPAM_SWITCH_PREFIX" || return
7677# Prefix of the current opam switch
7778OPAM_SWITCH_PREFIX='${BASEDIR}/root/fake'; export OPAM_SWITCH_PREFIX;
7879# Binary dir for opam switch fake
7980PATH='${BASEDIR}/root/fake/bin':"$PATH"; export PATH;
8081### test -f root/opam-init/variables.zsh
8182# Return code 1 #
8283### cat root/opam-init/variables.fish | grep -v man | grep -v MANPATH
84+ test -n "$OPAM_SWITCH_PREFIX"; and return
8385# Prefix of the current opam switch
8486set -gx OPAM_SWITCH_PREFIX '${BASEDIR}/root/fake';
8587# Binary dir for opam switch fake
8688set -gx PATH '${BASEDIR}/root/fake/bin' $PATH;
8789### cat root/opam-init/variables.csh | grep -v man | grep -v MANPATH
90+ if ( ${?OPAM_SWITCH_PREFIX} ) then
91+ if ( "$OPAM_SWITCH_PREFIX" != "") exit
92+ endif
8893# Prefix of the current opam switch
8994setenv OPAM_SWITCH_PREFIX '${BASEDIR}/root/fake'
9095# Binary dir for opam switch fake
9196if ( ! ${?PATH} ) setenv PATH ""
9297setenv PATH '${BASEDIR}/root/fake/bin':"$PATH"
9398### cat root/opam-init/variables.cmd | grep -v man | grep -v MANPATH
99+ if defined OPAM_SWITCH_PREFIX goto :EOF
94100:: Prefix of the current opam switch
95101set "OPAM_SWITCH_PREFIX=${BASEDIR}/root/fake"
96102:: Binary dir for opam switch fake
97103set "PATH=${BASEDIR}/root/fake/bin:%PATH%"
98104### cat root/opam-init/variables.ps1 | grep -v man | grep -v MANPATH
105+ if ($env:OPAM_SWITCH_PREFIX) { return }
99106# Prefix of the current opam switch
100107$env:OPAM_SWITCH_PREFIX='${BASEDIR}/root/fake'
101108# Binary dir for opam switch fake
0 commit comments