[[-n"$DEBUG"]]&&echo Conda env name to create: $CONDA_ENV
[[-n"$DEBUG"]]&&echo Conda env name to create: $CONDA_ENV
conda create -y-n$CONDA_ENVpython==$PYVER&& conda run -n$CONDA_ENV conda install-y conda-build anaconda-client
conda create -y-n$CONDA_ENVpython==$PYVER&& conda run -n$CONDA_ENV conda install-y conda-build anaconda-client&& conda config --add channels conda-forge # conda-forge used for numpy 1.22 on windows and macosx but maybe an update on anaconda channel will come soon
[[!"$?"= 0 ]]&&echo"Error: failed to setup the conda environment"&&exit 5
[[!"$?"= 0 ]]&&echo"Error: failed to setup the conda environment"&&exit 5
#conda init bash
#conda init bash
fi
fi
# conda-activate is only for interactive shell, so use run
# conda-activate is only for interactive shell, so use run
#conda activate $CONDA_ENV || echo "Error: failed to activate the conda env $ENV" && exit 6
#conda activate $CONDA_ENV || echo "Error: failed to activate the conda env $ENV" && exit 6
CONDA_PATH_ENV_PREFIX=$(conda info | grep"envs directories" | head-1 | cut-d: -f2)
#CONDA_PATH_ENV_PREFIX=$(conda info | grep "envs directories" | head -1 | cut -d: -f2)
CONDA_PATH_ENV_PREFIX=$(conda info | grep"envs directories" | head-1 | sed-e's/[^:]*: \(.*\)/\1/')
PKG=$(find_pkg)
PKG=$(find_pkg)
if[[-z"$PKG"||!-r"$PKG"]]
if[[-z"$PKG"||!-r"$PKG"]]
then
then
[[-n"$DEBUG"]]&&echo"conda env used to build: $CONDA_ENV"
conda run -n$CONDA_ENV conda build pyfaust
conda run -n$CONDA_ENV conda build pyfaust
else
echo"pyfaust conda package already built: $PKG"
fi
fi
[[!"$?"= 0 ]]&&echo"Error: failed to build pyfaust conda package"&&exit 7
[[!"$?"= 0 ]]&&echo"Error: failed to build pyfaust conda package"&&exit 7