1 2 3 4 5 6 7 8 9
#! /usr/bin/env sh cargo fmt -- --check code="$?" if [ "$code" -ne 0 ]; then echo "Please run \`cargo fmt' before committing" exit "$code" fi