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

use python3 in easy-deploy script if available #894

Merged
merged 1 commit into from
Oct 30, 2018
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
13 changes: 10 additions & 3 deletions easy-deploy-script/easy-deploy-viral-ngs.sh
Original file line number Diff line number Diff line change
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