From 9e65540cd840235dae17d2d076e440f84905db8a Mon Sep 17 00:00:00 2001 From: Dominic Date: Wed, 3 Feb 2021 22:37:34 +0100 Subject: [PATCH] ci: make the rustfmt.sh script ash-compatible --- tests/ui/rustfmt.sh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tests/ui/rustfmt.sh b/tests/ui/rustfmt.sh index c33dedf..b5724e4 100755 --- a/tests/ui/rustfmt.sh +++ b/tests/ui/rustfmt.sh @@ -1,11 +1,17 @@ -#!/bin/bash +#!/bin/busybox ash set -euo pipefail rustfmt=${RUSTFMT:-rustfmt} version="$($rustfmt -V)" -if [[ $version != *nightly* ]]; then - rustfmt="$rustfmt +nightly" -fi +case "$version" in + *nightly*) + # all good, no additional flags required + ;; + *) + # assume we're using some sort of rustup setup + rustfmt="$rustfmt +nightly" + ;; +esac return=0 find "$(dirname "$0")" -name '*.rs' -type f | while read file; do