Skip to content

Commit

Permalink
Merge 2ad104b into c5aa4f8
Browse files Browse the repository at this point in the history
  • Loading branch information
tomkinsc committed Oct 30, 2018
2 parents c5aa4f8 + 2ad104b commit bbd756c
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions easy-deploy-script/easy-deploy-viral-ngs.sh
Expand Up @@ -73,7 +73,7 @@ if [ $current_prefix_length -ge $CONDA_PREFIX_LENGTH_LIMIT ]; then
exit 80
fi

python_check=$(hash python)
python_check=$(hash python &> /dev/null || hash python3 &> /dev/null)
if [ $? -ne 0 ]; then
echo "It looks like Python is not installed. Exiting."
if [[ $sourced -eq 0 ]]; then
Expand All @@ -83,7 +83,14 @@ if [ $? -ne 0 ]; then
fi
fi

ram_check=$(python -c "bytearray(768000000)" &> /dev/null)
python3_check=$(hash python3 &> /dev/null)
if [ $? -eq 0 ]; then
python_to_use="$(which python3)"
fi

$python_to_use --version

ram_check=$($python_to_use -c "bytearray(768000000)" &> /dev/null)
if [ $? -ne 0 ]; then
echo ""
echo "Unable to allocate 768MB."
Expand Down Expand Up @@ -200,7 +207,7 @@ function install_miniconda(){
else
echo "Downloading and installing Miniconda..."

if [[ "$(python -c 'import os; print(os.uname()[0])')" == "Darwin" ]]; then
if [[ "$($python_to_use -c 'import os; print(os.uname()[0])')" == "Darwin" ]]; then
miniconda_url=https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh
else
miniconda_url=https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
Expand Down

0 comments on commit bbd756c

Please sign in to comment.