#!/usr/bin/env bash # # Usage: # maint/forbid-absolute-shebangs # # Requires that scripts all start with `#! /usr/bin/env`, # not a path to a specific interpreter. set -euo pipefail # this include stanza is automatically maintained by update-shell-includes common_dir=$(realpath "$0") common_dir=$(dirname "$common_dir") # shellcheck source=maint/common/bash-utils.sh . "$common_dir"/bash-utils.sh reject_all_arguments if git grep -rnI '^#\!/' :/ | grep -v '#\!/usr/bin/env' then echo "Absolute shebangs found, replace them with \"#!/usr/bin/env\"" exit 1 else echo "Everything seems ok" exit 0 fi