#!/bin/bash
#
# Copyright (c) 2024 Mike Tsao

for f in $(find . -name \*.rs -not -path "./target/*" -not -path "./vendor/*")
do
    if ! grep -q -E '^\/\/ Copyright' "$f"
    then
        echo "$f missing header"
        exit 1
    fi
done

cargo fmt --all && \
    cargo doc --no-deps --workspace --examples && \
    cargo test --workspace

# cargo build --no-default-features && \
# this is disabled - see https://github.com/ensnare-org/ensnare/issues/1
