Fix shell coding style
parent
0f0a07c7fe
commit
239f38729d
|
@ -7,24 +7,24 @@ set -o nounset
|
||||||
WANTED_VERSION="${1:-}"
|
WANTED_VERSION="${1:-}"
|
||||||
INSTALLME=@composer
|
INSTALLME=@composer
|
||||||
if test -n "$WANTED_VERSION"; then
|
if test -n "$WANTED_VERSION"; then
|
||||||
INSTALLME="$INSTALLME-$1"
|
INSTALLME="$INSTALLME-$1"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
CI=true ./install-php-extensions "$INSTALLME"
|
CI=true ./install-php-extensions "$INSTALLME"
|
||||||
|
|
||||||
INSTALLED_VERSION="$(composer --version | sed -E 's/^.*[Vv]ersion\s*(\S+).*$/\1/')"
|
INSTALLED_VERSION="$(composer --version | sed -E 's/^.*[Vv]ersion\s*(\S+).*$/\1/')"
|
||||||
if test -z "$WANTED_VERSION"; then
|
if test -z "$WANTED_VERSION"; then
|
||||||
echo 'Installing the latest version worked'
|
echo 'Installing the latest version worked'
|
||||||
elif printf '%s' "$WANTED_VERSION" | grep -Eq '^[0-9]+$'; then
|
elif printf '%s' "$WANTED_VERSION" | grep -Eq '^[0-9]+$'; then
|
||||||
if test "${INSTALLED_VERSION#$WANTED_VERSION.}" = "$INSTALLED_VERSION"; then
|
if test "${INSTALLED_VERSION#$WANTED_VERSION.}" = "$INSTALLED_VERSION"; then
|
||||||
printf 'Installing major version %s DID NOT worked (we installed version %s)\n' "$WANTED_VERSION" "$INSTALLED_VERSION"
|
printf 'Installing major version %s DID NOT worked (we installed version %s)\n' "$WANTED_VERSION" "$INSTALLED_VERSION"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
printf 'Installing major version %s worked (we installed version %s)\n' "$WANTED_VERSION" "$INSTALLED_VERSION"
|
printf 'Installing major version %s worked (we installed version %s)\n' "$WANTED_VERSION" "$INSTALLED_VERSION"
|
||||||
else
|
else
|
||||||
if test "$INSTALLED_VERSION" != "$WANTED_VERSION"; then
|
if test "$INSTALLED_VERSION" != "$WANTED_VERSION"; then
|
||||||
printf 'Installing specific version %s DID NOT worked (we installed version %s)\n' "$WANTED_VERSION" "$INSTALLED_VERSION"
|
printf 'Installing specific version %s DID NOT worked (we installed version %s)\n' "$WANTED_VERSION" "$INSTALLED_VERSION"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
printf 'Installing specific version %s worked\n' "$INSTALLED_VERSION"
|
printf 'Installing specific version %s worked\n' "$INSTALLED_VERSION"
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -8,19 +8,19 @@ WANTED_VERSION="${1:-}"
|
||||||
WANTED_VERSION_AFTERCARET="${1#^}"
|
WANTED_VERSION_AFTERCARET="${1#^}"
|
||||||
INSTALLME=xdebug
|
INSTALLME=xdebug
|
||||||
if test -n "$WANTED_VERSION"; then
|
if test -n "$WANTED_VERSION"; then
|
||||||
INSTALLME="$INSTALLME-$1"
|
INSTALLME="$INSTALLME-$1"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
CI=true ./install-php-extensions "$INSTALLME"
|
CI=true ./install-php-extensions "$INSTALLME"
|
||||||
|
|
||||||
INSTALLED_VERSION="$(php --ri xdebug | grep -Ei 'Version\s*=>\s*' | sed -E 's/^.*?=>\s*//')"
|
INSTALLED_VERSION="$(php --ri xdebug | grep -Ei 'Version\s*=>\s*' | sed -E 's/^.*?=>\s*//')"
|
||||||
if test -z "$WANTED_VERSION"; then
|
if test -z "$WANTED_VERSION"; then
|
||||||
printf 'Installing the default version worked (we installed version %s)\n' "$INSTALLED_VERSION"
|
printf 'Installing the default version worked (we installed version %s)\n' "$INSTALLED_VERSION"
|
||||||
elif test "$WANTED_VERSION" = "$INSTALLED_VERSION"; then
|
elif test "$WANTED_VERSION" = "$INSTALLED_VERSION"; then
|
||||||
printf 'Installing specific version %s worked\n' "$WANTED_VERSION"
|
printf 'Installing specific version %s worked\n' "$WANTED_VERSION"
|
||||||
elif test "$WANTED_VERSION" != "$WANTED_VERSION_AFTERCARET" && test "${INSTALLED_VERSION#$WANTED_VERSION_AFTERCARET.}" != "$INSTALLED_VERSION"; then
|
elif test "$WANTED_VERSION" != "$WANTED_VERSION_AFTERCARET" && test "${INSTALLED_VERSION#$WANTED_VERSION_AFTERCARET.}" != "$INSTALLED_VERSION"; then
|
||||||
printf 'Installing version compatible with %s worked (we installed version %s)\n' "$WANTED_VERSION" "$INSTALLED_VERSION"
|
printf 'Installing version compatible with %s worked (we installed version %s)\n' "$WANTED_VERSION" "$INSTALLED_VERSION"
|
||||||
else
|
else
|
||||||
printf 'We wanted to install version %s, but we installed %s\n' "$WANTED_VERSION" "$INSTALLED_VERSION" >&2
|
printf 'We wanted to install version %s, but we installed %s\n' "$WANTED_VERSION" "$INSTALLED_VERSION" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in New Issue