1
0
Fork 0
mirror of https://gitlab.com/msrd0/gotham-restful.git synced 2025-02-23 04:52:28 +00:00
deprecated-gotham-restful/tests/ui/rustfmt.sh

15 lines
334 B
Bash
Executable file

#!/bin/bash
set -euo pipefail
rustfmt=${RUSTFMT:-rustfmt}
version="$($rustfmt -V)"
if [[ $version != *nightly* ]]; then
rustfmt="$rustfmt +nightly"
fi
return=0
find "$(dirname "$0")" -name '*.rs' -type f | while read file; do
$rustfmt --config-path "$(dirname "$0")/../../rustfmt.toml" "$@" "$file" || return=1
done
exit $return