#!/bin/sh check_license() { local path="$1" if ! grep -q "LGPL-3.0-or-later OR Apache-2.0" "$path"; then echo "$path lacks of the license." >&2 exit 1 fi } ( cd `git rev-parse --show-toplevel` for f in $(find src -name '*.rs' -type f); do check_license "$f" done cargo fmt -- --check || exit "$?" cargo test || exit "$?" exit 0 )