-
Notifications
You must be signed in to change notification settings - Fork 1
/
install
executable file
·31 lines (26 loc) · 1014 Bytes
/
install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash
# Install into ~/.local for the versions of python listed in 'pythons' below.
#
# If instead you want to install into /usr/lib or into a virtual environment,
# use:
# pip install engfmt
#
# Requires Python 2.6 or better or Python 3.2 or better.
cmd=engfmt
pythons=(python)
# Add the versions of python you would like to install to above
for python in ${pythons[*]}; do
# Determine the version of python we are using
vers=$($python -c 'import sys; print("%s.%s" % (sys.version_info[0], sys.version_info[1]))')
echo "Installing $cmd to ~/.home/bin (Python$vers)."
# remove build directories from a previous install to assure a clean install
rm -rf build dist $cmd.egg-info install.out
# install $cmd
$python setup.py install --quiet --user >& install.out
if [[ $? -ne 0 ]] ; then
echo "Problems found, aborting (see install.out)"
exit 1
fi
done
# remove build directories, because I like a clean directory
rm -rf build dist $cmd.egg-info