mirror of
https://gitlab.com/msrd0/gotham-restful.git
synced 2025-02-23 04:52:28 +00:00
15 lines
334 B
Bash
Executable file
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
|