1
0
Fork 0
mirror of https://gitlab.com/msrd0/gotham-restful.git synced 2025-02-22 12:42:28 +00:00

ci: make the rustfmt.sh script ash-compatible

This commit is contained in:
Dominic 2021-02-03 22:37:34 +01:00
parent 44e2f0317c
commit 9e65540cd8
Signed by: msrd0
GPG key ID: DCC8C247452E98F9

View file

@ -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