@@ -80,6 +80,42 @@ END_OF_LINE
80
80
exit 1
81
81
fi
82
82
83
+ # Check to see if pyenv is installed
84
+ if [ -z " $( command -v pyenv) " ] || { [ -z " $( command -v pyenv-virtualenv) " ] && [ ! -f " $( pyenv root) /plugins/pyenv-virtualenv/bin/pyenv-virtualenv" ]; }; then
85
+ echo " pyenv and pyenv-virtualenv are required."
86
+ if [[ " $OSTYPE " == " darwin" * ]]; then
87
+ cat << 'END_OF_LINE '
88
+
89
+ On the Mac, we recommend installing brew, https://brew.sh/. Then installation
90
+ is as simple as `brew install pyenv pyenv-virtualenv` and adding this to your
91
+ profile:
92
+
93
+ eval "$(pyenv init -)"
94
+ eval "$(pyenv virtualenv-init -)"
95
+
96
+ END_OF_LINE
97
+
98
+ fi
99
+ cat << 'END_OF_LINE '
100
+ For Linux, Windows Subsystem for Linux (WSL), or on the Mac (if you don't want
101
+ to use "brew") you can use https://github.com/pyenv/pyenv-installer to install
102
+ the necessary tools. Before running this ensure that you have installed the
103
+ prerequisites for your platform according to the pyenv wiki page,
104
+ https://github.com/pyenv/pyenv/wiki/common-build-problems.
105
+
106
+ On WSL you should treat your platform as whatever Linux distribution you've
107
+ chosen to install.
108
+
109
+ Once you have installed "pyenv" you will need to add the following lines to
110
+ your ".bashrc":
111
+
112
+ export PATH="$PATH:$HOME/.pyenv/bin"
113
+ eval "$(pyenv init -)"
114
+ eval "$(pyenv virtualenv-init -)"
115
+ END_OF_LINE
116
+ exit 1
117
+ fi
118
+
83
119
# Use GNU getopt to parse options
84
120
if ! PARSED=$( getopt --options $SHORTOPTS --longoptions $LONGOPTS --name " $0 " -- " $@ " ) ; then
85
121
echo " Error parsing options"
@@ -135,42 +171,6 @@ while true; do
135
171
esac
136
172
done
137
173
138
- # Check to see if pyenv is installed
139
- if [ -z " $( command -v pyenv) " ] || { [ -z " $( command -v pyenv-virtualenv) " ] && [ ! -f " $( pyenv root) /plugins/pyenv-virtualenv/bin/pyenv-virtualenv" ]; }; then
140
- echo " pyenv and pyenv-virtualenv are required."
141
- if [[ " $OSTYPE " == " darwin" * ]]; then
142
- cat << 'END_OF_LINE '
143
-
144
- On the Mac, we recommend installing brew, https://brew.sh/. Then installation
145
- is as simple as `brew install pyenv pyenv-virtualenv` and adding this to your
146
- profile:
147
-
148
- eval "$(pyenv init -)"
149
- eval "$(pyenv virtualenv-init -)"
150
-
151
- END_OF_LINE
152
-
153
- fi
154
- cat << 'END_OF_LINE '
155
- For Linux, Windows Subsystem for Linux (WSL), or on the Mac (if you don't want
156
- to use "brew") you can use https://github.com/pyenv/pyenv-installer to install
157
- the necessary tools. Before running this ensure that you have installed the
158
- prerequisites for your platform according to the pyenv wiki page,
159
- https://github.com/pyenv/pyenv/wiki/common-build-problems.
160
-
161
- On WSL you should treat your platform as whatever Linux distribution you've
162
- chosen to install.
163
-
164
- Once you have installed "pyenv" you will need to add the following lines to
165
- your ".bashrc":
166
-
167
- export PATH="$PATH:$HOME/.pyenv/bin"
168
- eval "$(pyenv init -)"
169
- eval "$(pyenv virtualenv-init -)"
170
- END_OF_LINE
171
- exit 1
172
- fi
173
-
174
174
# Determine the virtual environment name
175
175
if [ -n " $VENV_NAME " ]; then
176
176
# Use the user-provided environment name
0 commit comments