#!/usr/bin/env bash # The script is meant to check if the rules regarding packages # dependencies are satisfied. # The general format is: # [top-lvl-dir]<[crate-name-prefix] # For instance no crate within `./client` directory # is allowed to import any crate with a directory path containing `paint`. # Such rule is just: `client /dev/null done # Display violations and fail I=0 for v in "${VIOLATIONS[@]}" do cat << EOF =========================================== ======= Violation of rule: $v =========================================== ${PACKAGES[$I]} EOF I=$I+1 done exit ${#VIOLATIONS[@]}