canary-rs/check_licenses.sh

13 lines
338 B
Bash
Raw Normal View History

2022-11-03 02:25:04 +00:00
#!/bin/sh
2022-11-12 04:56:48 +00:00
set -e
# check if we have rg(1)
if ! command -v rg >/dev/null 2>&1; then
printf "%s: Missing dependency: rg(1)\n" "$0" 1>&2
2022-11-12 04:59:40 +00:00
exit 69 # sysexits(3) EX_UNAVAILABLE
2022-11-12 04:56:48 +00:00
else
rg --multiline --files-without-match --glob '*.rs' --pcre2 \
'(?<!\n)((//)|(#)) Copyright \(c\) \d+ [A-z, ]+\n((//)|(#)) SPDX-License-Identifier: .*\n'
fi