Skip to content

Commit 6f283c6

Browse files
committed
fix: reflect README
1 parent 6e83fee commit 6f283c6

File tree

1 file changed

+22
-11
lines changed

1 file changed

+22
-11
lines changed

conda/install.sh

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,33 @@
1-
#!/bin/bash -xe
1+
#!/bin/bash -e
22

3-
conda=""
4-
if $(which mamba)
3+
CONDA=""
4+
if which mamba > /dev/null
55
then
6-
conda=$(which mamba)
6+
CONDA=$(which mamba)
77
fi
8-
if $(which conda)
8+
if which conda > /dev/null
99
then
10-
conda=$(which conda)
10+
CONDA=$(which conda)
1111
fi
12-
if [ -z $conda ]
12+
13+
if [ -z $CONDA ]
1314
then
1415
echo "Error: conda or mamba is not installed or is not in the PATH."
16+
echo "Go to "
17+
echo "* https://github.com/conda-forge/miniforge (open source)"
18+
echo "* https://www.anaconda.com/download/success (registration required)"
19+
echo "to obtain a conda/mamba installer."
20+
else
21+
echo "Using $CONDA for environment setup"
1522
fi
1623

17-
echo "using $conda for environment setup"
1824

19-
$conda env remove -y -n mellea || true
20-
$conda env create -f environment.yml
25+
# note:
26+
# this is a portable way (works in linux and osx) to get the directory of this script.
27+
# readlink -ef may not work on osx.
28+
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
29+
$CONDA env create -f $SCRIPT_DIR/environment.yml
30+
31+
$CONDA run -n mellea uv pip install -e .[all] --group dev --group notebook --group docs
2132

22-
$conda run -n mellea uv pip install -e .[all] --group dev
33+
$CONDA run -n mellea pre-commit install

0 commit comments

Comments
 (0)