[ADD] DCOS-2301 pip version check to install script
This commit is contained in:
@@ -7,11 +7,26 @@ usage()
|
||||
echo "$(basename "$(test -L "$0" && readlink "$0" || echo "$0")") <installation-path> <dcos-url>"
|
||||
}
|
||||
|
||||
check_pip_version()
|
||||
{
|
||||
PIP_INFO=$(pip -V);
|
||||
REGEX="([0-9]+)\.([0-9]+)";
|
||||
[[ $PIP_INFO =~ $REGEX ]];
|
||||
MAJOR_PIP_VERSION="${BASH_REMATCH[1]}";
|
||||
MINOR_PIP_VERSION="${BASH_REMATCH[2]}";
|
||||
if [ "$MAJOR_PIP_VERSION" -lt 1 ] || ([ "$MAJOR_PIP_VERSION" -eq 1 ] && [ "$MINOR_PIP_VERSION" -le 4 ]);
|
||||
then echo "Pip version must be greater than 1.4. Aborting.";
|
||||
exit 1;
|
||||
fi
|
||||
}
|
||||
|
||||
if [ "$#" -lt 2 ]; then
|
||||
usage;
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
check_pip_version;
|
||||
|
||||
ARGS=( "$@" );
|
||||
|
||||
VIRTUAL_ENV_PATH=$(python -c "import os; print(os.path.realpath('"${ARGS[0]}"'))")
|
||||
|
||||
@@ -29,6 +29,15 @@ if (-Not(Get-Command pip -errorAction SilentlyContinue))
|
||||
exit 1
|
||||
}
|
||||
|
||||
$PIP_VERSION = (pip -V)
|
||||
|
||||
"$PIP_VERSION" -match "[0-9]+\.[0-9]+"
|
||||
|
||||
if ([double]$matches[0] -le 1.4) {
|
||||
echo "Pip version must be greater than 1.4. Aborting."
|
||||
exit 1
|
||||
}
|
||||
|
||||
if (-Not(Get-Command virtualenv -errorAction SilentlyContinue))
|
||||
{
|
||||
echo "The program 'virtualenv' could not be found. Make sure that it has been installed with the 'pip' Python package program."
|
||||
|
||||
Reference in New Issue
Block a user