Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] condainstall: Fix env for running conda #3843

Merged
merged 1 commit into from
May 31, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions scripts/windows/condainstall.bat
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ rem Target install prefix
set PREFIX=%~1
rem Path to conda executable
set CONDA=%~2
rem Path to base conda env
for /f %%f in ( '"%CONDA%" info --root' ) do (
set "CONDA_BASE_PREFIX=%%f"
)

if not exist "%PREFIX%\python.exe" (
echo Creating a conda env in "%PREFIX%"
Expand All @@ -25,13 +21,23 @@ if not exist "%PREFIX%\python.exe" (
)
)

for %%f in ( *.tar.bz2 ) do (
echo Installing: %%f
"%CONDA%" install --yes --copy --quiet --prefix "%PREFIX%" "%CD%\%%f" ^
|| exit /b !ERRORLEVEL!
)

rem # Create .condarc file that includes conda-forge channel
rem # We need it so add-ons can be installed from conda-forge
echo Appending conda-forge channel
echo channels: > "%PREFIX%\.condarc"
echo - conda-forge >> "%PREFIX%\.condarc"
echo - defaults >> "%PREFIX%\.condarc"

rem Path to base conda env
for /f %%f in ( '"%CONDA%" info --root' ) do (
set "CONDA_BASE_PREFIX=%%f"
)
rem # `conda create` (at least since 4.5) does not add the conda.bat script,
rem # so we create it manually (has different env activation pattern).
set "CONDA_BAT=%PREFIX%\Scripts\conda.bat"
Expand All @@ -46,9 +52,3 @@ if not exist "%ACTIVATE_BAT%" (
echo @echo off > "%ACTIVATE_BAT%"
echo call "%CONDA_BASE_PREFIX%\Scripts\activate.bat" "%PREFIX%" >> "%ACTIVATE_BAT%"
)

for %%f in ( *.tar.bz2 ) do (
echo Installing: %%f
"%CONDA%" install --yes --copy --quiet --prefix "%PREFIX%" "%CD%\%%f" ^
|| exit /b !ERRORLEVEL!
)