Skip to content

Commit

Permalink
Check for set -euo pipefail
Browse files Browse the repository at this point in the history
  • Loading branch information
strugee committed Oct 10, 2024
1 parent 973423a commit 9c298de
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,8 @@ trap 'echo Failed!' ERR
echo 'Checking that all `flatpak` invocations pass `--system`.'
# We use () to make this a subshell to avoid ! not triggering a `set -e` bailout; see bash(1)'s documentation on this flag for more
( ! grep -n flatpak *.sh | grep -v -- --system )

for i in bin/* sbin/*; do
echo 'Checking that `'"$i"'` contains `set -euo pipefail`.'
grep -q 'set -euo pipefail' $i
done
2 changes: 2 additions & 0 deletions sbin/seagl-reset-users
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

set -euo pipefail

if ! [ $(id -u) == 0 ]; then
echo must be run as root 1>&2
exit 1
Expand Down

0 comments on commit 9c298de

Please sign in to comment.