summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Finnie <ryan@finnie.org>2021-02-17 22:15:50 -0800
committerLuca Boccassi <bluca@debian.org>2021-02-18 08:48:27 +0000
commit8a8e11e5d1c747890e1f63c4e821974851c22314 (patch)
tree4a7dcc1aa96b6500496ac1c5b9a8a59efe6aae68
parenta0400b24998e247f32f95a492ed4f3f6ab053ada (diff)
downloadvyos-live-build-8a8e11e5d1c747890e1f63c4e821974851c22314.tar.gz
vyos-live-build-8a8e11e5d1c747890e1f63c4e821974851c22314.zip
No mksquashfs progress bar if stdin is not a terminal
Explicitly documented updated conditional, as "-t" is not a commonly seen shell test.
-rwxr-xr-xscripts/build/binary_rootfs5
1 files changed, 4 insertions, 1 deletions
diff --git a/scripts/build/binary_rootfs b/scripts/build/binary_rootfs
index 78fe6633e..354fc8d87 100755
--- a/scripts/build/binary_rootfs
+++ b/scripts/build/binary_rootfs
@@ -265,7 +265,10 @@ case "${LB_CHROOT_FILESYSTEM}" in
# Remove stale squashfs image
rm -f chroot/filesystem.squashfs
- if [ "${_QUIET}" = "true" ]
+ # Do not display progress bar if:
+ # - Run with --quiet, or
+ # - stdin is not a terminal (e.g. in CI, cron, etc)
+ if [ "${_QUIET}" = "true" ] || [ ! -t 0 ]
then
MKSQUASHFS_OPTIONS="-no-progress ${MKSQUASHFS_OPTIONS}"
fi