blob: 9c211eb7b1fff449b2a1f60fc8a471c62d342a64 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
#!/usr/bin/env bash
# Copyright 2020 syzkaller project authors. All rights reserved.
# Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
FAILED=""
FILES=0
for F in $(find . -perm -u=x -type f | grep -E -v "/gen/|/.git"); do
((FILES+=1))
if head -n 1 "$F" | grep -E -q '^#!/' && head -n 1 "$F" | grep -E -v -q -e '^#!/bin/sh$' -e '^#!/usr/bin/env '; then
echo "$F: Non-portable shebang line. Please use /usr/bin/env to locate the interpreter."
FAILED=1
fi
done
[ -n "$FAILED" ] && exit 1
echo "$FILES files checked for non-portable shebang lines"
|