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 0c55add commit c77975aCopy full SHA for c77975a
StaticAnalysis/prelude_rearrange.sh
@@ -1,4 +1,5 @@
1
#!/bin/bash
2
+. ../prelude.sh
3
set -euo pipefail
4
5
# Find all .sh files and process each one
pre-commit-hook.sh
@@ -33,3 +33,15 @@ find . -type f -name "*.sh" -print0 \
33
# I am passing the filename as a parameter to the bash subshell
34
# find . -type f -name "*.sh" -execdir \
35
# bash -c 'echo "### Entering directory $(pwd)" && shellcheck "${1}"' bash {} \;
36
+#
37
+
38
+find . -type f -name '*.sh' \( \
39
+ ! -name "prelude.sh" \
40
+ \) -print0 \
41
+ | while IFS= read -r -d '' f; do
42
+ if ! sed -n '2p' "$f" \
43
+ | grep -Eq '^\.[[:space:]]+(\.\./)*prelude\.sh$'; then
44
+ err "File does not have . prelude.sh on the 2nd line: $f"
45
+ exit 2
46
+ fi
47
+ done
0 commit comments