Skip to content

Commit a6a8c66

Browse files
keldLundgaardpjbull
authored andcommitted
Check for conda before using it to create an environment.
1 parent adf935b commit a6a8c66

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

{{ cookiecutter.repo_name }}/Makefile

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@
77
BUCKET = {{ cookiecutter.s3_bucket }}
88
PROJECT_NAME = {{ cookiecutter.repo_name }}
99
PYTHON_INTERPRETER = {{ cookiecutter.python_interpreter }}
10-
IS_ANACONDA=$(shell python -c "import sys;t=str('anaconda' in sys.version.lower() or 'continuum' in sys.version.lower());sys.stdout.write(t)")
10+
11+
ifeq (,$(shell which conda))
12+
HAS_CONDA=False
13+
else
14+
HAS_CONDA=True
15+
endif
1116

1217
#################################################################################
1318
# COMMANDS #
@@ -39,8 +44,8 @@ sync_data_from_s3:
3944

4045
## Set up python interpreter environment
4146
create_environment:
42-
ifeq (True,$(IS_ANACONDA))
43-
@echo ">>> Detected Anaconda, creating conda environment."
47+
ifeq (True,$(HAS_CONDA))
48+
@echo ">>> Detected conda, creating conda environment."
4449
ifeq (3,$(findstring 3,$(PYTHON_INTERPRETER)))
4550
conda create --name $(PROJECT_NAME) python=3.5
4651
else

0 commit comments

Comments
 (0)