Ensure scripts are set -u
This will hopefully catch bugs where they happen rather than allowing scripts to continue on and fail later. Change-Id: Idacd9274415b21db285a198dafff19b1d19a4a68
This commit is contained in:
parent
16be6d7ce0
commit
e0650572f2
@ -66,7 +66,7 @@ for i in $(find elements -type f); do
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check that all scripts are set -e
|
# Check that all scripts are set -eu
|
||||||
# NOTE(bnemec): This doesn't verify that the set call occurs high
|
# NOTE(bnemec): This doesn't verify that the set call occurs high
|
||||||
# enough in the file to be useful, but hopefully nobody will be
|
# enough in the file to be useful, but hopefully nobody will be
|
||||||
# sticking set calls at the end of their file to trick us. And if
|
# sticking set calls at the end of their file to trick us. And if
|
||||||
@ -82,6 +82,12 @@ for i in $(find elements -type f); do
|
|||||||
rc=1
|
rc=1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
if ! excluded setu; then
|
||||||
|
if [ -z "$(grep "^set -[^ ]*u" $i)" ]; then
|
||||||
|
echo "ERROR: $i is not set -u"
|
||||||
|
rc=1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
exit $rc
|
exit $rc
|
||||||
|
Loading…
Reference in New Issue
Block a user