2019-12-20 17:26:26 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
set -o errexit
|
|
|
|
set -o nounset
|
|
|
|
|
|
|
|
if ! docker --version >/dev/null 2>/dev/null; then
|
|
|
|
printf 'Docker is not installed, or it is not running\n' >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2019-12-20 17:44:45 +00:00
|
|
|
SRC_DIR="$(CDPATH= cd -- "$(dirname -- "$0")" && cd .. pwd)"
|
2019-12-20 17:26:26 +00:00
|
|
|
|
|
|
|
if ! docker build -t docker-php-extension-installer-shfmt:latest -f scripts/Dockerfile-shfmt -q .; then
|
|
|
|
printf 'ERROR!' >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2019-12-20 17:44:45 +00:00
|
|
|
if ! docker run --rm -v "$SRC_DIR:/src" -w /src docker-php-extension-installer-shfmt:latest ./scripts/invoke-shfmt fix; then
|
|
|
|
printf 'ERROR!' >&2
|
|
|
|
exit 1
|
|
|
|
fi
|