Skip to content

Commit ffeef40

Browse files
committed
Only specify docker image in 1 place in format.sh
1 parent 43cd72c commit ffeef40

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

scripts/format.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
set -eo pipefail
44

55
pushd "$(dirname "${BASH_SOURCE[0]}")/.." > /dev/null
6+
DOCKER_IMAGE="docker.io/swift:6.0.2"
67

78
if which swift > /dev/null 2>&1; then
89
SWIFTFORMAT="./.build/debug/swiftformat"
@@ -29,13 +30,13 @@ elif which docker > /dev/null 2>&1; then
2930
docker run --rm \
3031
--volume .:/workspace \
3132
--user "$(id -u):$(id -g)" \
32-
docker.io/swift:6.0.2 \
33+
"$DOCKER_IMAGE" \
3334
"/workspace/scripts/$(basename "${BASH_SOURCE[0]}")"
3435
elif which podman > /dev/null 2>&1; then
3536
podman run --rm \
3637
--volume .:/workspace \
3738
--userns=keep-id \
38-
docker.io/swift:6.0.2 \
39+
"$DOCKER_IMAGE" \
3940
"/workspace/scripts/$(basename "${BASH_SOURCE[0]}")"
4041
else
4142
echo "Either 'swift', 'docker' or 'podman' has to be installed to run swiftformat."

0 commit comments

Comments
 (0)