mirror of
https://blitiri.com.ar/repos/chasquid
synced 2025-12-17 14:37:02 +00:00
Improve bash quoting, and other similar best practices
This patch updates the shell scripts with some of the common best practices, which should make them more resilient to unusual failures and unexpected environments (in particular, directories with spaces). Most of these were identified by shellcheck.
This commit is contained in:
@@ -8,20 +8,20 @@
|
||||
set -e
|
||||
|
||||
for IN in *.pod; do
|
||||
OUT=$( basename $IN .pod )
|
||||
OUT=$(basename "$IN" .pod)
|
||||
SECTION=${OUT##*.}
|
||||
NAME=${OUT%.*}
|
||||
|
||||
# If it has not changed in git, set the mtime to the last commit that
|
||||
# touched the file.
|
||||
CHANGED=$( git status --porcelain -- "$IN" | wc -l )
|
||||
if [ $CHANGED -eq 0 ]; then
|
||||
if [ "$CHANGED" -eq 0 ]; then
|
||||
GIT_MTIME=$( git log --pretty=%at -n1 -- "$IN" )
|
||||
touch -d "@$GIT_MTIME" "$IN"
|
||||
fi
|
||||
|
||||
podchecker $IN
|
||||
pod2man --section=$SECTION --name=$NAME \
|
||||
podchecker "$IN"
|
||||
pod2man --section="$SECTION" --name="$NAME" \
|
||||
--release "" --center "" \
|
||||
$IN $OUT
|
||||
"$IN" "$OUT"
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user