Skip to content

Commit b91f148

Browse files
committed
style: Improve readability by adding quotes and consistent spacing in builder script
1 parent c1f7a31 commit b91f148

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

builder

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ source lib.sh
44
# Raspbian
55
RASPBIAN_TORRENT_URL=downloads.raspberrypi.org/raspios_arm64/images/raspios_arm64-2024-11-19/2024-11-19-raspios-bookworm-arm64.img.xz.torrent
66
RASPBIAN_SHA256=ea6e68c48d14c3d78af5471c0b288bbf6522fdd775241f74d8295d106d344300
7-
RASPBIAN_IMAGE_FILE=$(basename $RASPBIAN_TORRENT_URL | sed -e "s/.xz.torrent//g")
7+
RASPBIAN_IMAGE_FILE=$(basename "$RASPBIAN_TORRENT_URL" | sed -e 's/.xz.torrent//g')
88
EXTRA_IMAGE_SIZE=1978MB
99
MINIMAL_SPACE_LEFT=111111
1010

1111
missing_deps=()
1212
for prog in kpartx wget gpg parted qemu-arm-static aria2c jq curl; do
13-
if ! type $prog &>/dev/null ; then
13+
if ! type "$prog" &>/dev/null; then
1414
missing_deps+=( "$prog" )
1515
fi
1616
done
@@ -47,9 +47,9 @@ function _decompress_image {
4747
function _disable_daemons {
4848
# Prevent services from being started inside the chroot.
4949
POLICY_RC_D=mnt/img_root/usr/sbin/policy-rc.d
50-
echo "#!/bin/sh" >> $POLICY_RC_D
51-
echo "exit 101" >> $POLICY_RC_D
52-
chmod +x $POLICY_RC_D
50+
echo "#!/bin/sh" >> "$POLICY_RC_D"
51+
echo "exit 101" >> "$POLICY_RC_D"
52+
chmod +x "$POLICY_RC_D"
5353
}
5454

5555
function _enable_daemons {
@@ -60,16 +60,16 @@ function _enable_daemons {
6060
function _disable_ld_preload {
6161
cfg=mnt/img_root/etc/ld.so.preload
6262

63-
if grep -q '^[^#]' $cfg; then
64-
sed -i -e 's/^/#/' $cfg || die "Could not disable ld.so.preload"
63+
if grep -q '^[^#]' "$cfg"; then
64+
sed -i -e 's/^/#/' "$cfg" || die "Could not disable ld.so.preload"
6565
fi
6666
}
6767

6868
function _enable_ld_preload {
6969
cfg=mnt/img_root/etc/ld.so.preload
7070

71-
if grep -q '^#' $cfg; then
72-
sed -i -e 's/^#//' $cfg || die "Could not enable ld.so.preload"
71+
if grep -q '^#' "$cfg"; then
72+
sed -i -e 's/^#//' "$cfg" || die "Could not enable ld.so.preload"
7373
fi
7474
}
7575

0 commit comments

Comments
 (0)