We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 286523c commit 6829f4cCopy full SHA for 6829f4c
scapy/tools/check_spdx.sh
@@ -9,11 +9,23 @@
9
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
10
ROOT_DIR=$SCRIPT_DIR/../..
11
12
+# http://mywiki.wooledge.org/BashFAQ/024
13
+# This documents an absolutely WTF behavior of bash.
14
+set +m
15
+shopt -s lastpipe
16
+
17
function check_path() {
18
cd $ROOT_DIR
19
+ RCODE=0
20
for ext in "${@:2}"; do
- find $1 -name "*.$ext" -exec bash -c '[[ -z $(grep "SPDX" {}) ]] && echo "{}"' \;
21
+ find $1 -name "*.$ext" | while read f; do
22
+ if [[ -z $(grep "SPDX" $f) ]]; then
23
+ echo "$f"
24
+ RCODE=1
25
+ fi
26
+ done
27
done
28
+ return $RCODE
29
}
30
-check_path scapy py
31
+check_path scapy py || exit $?
0 commit comments