From 32a40e8ae91cc1cbc557dedbaf199d6691a056c6 Mon Sep 17 00:00:00 2001 From: ag-tsotetsi Date: Sun, 8 Feb 2026 12:26:13 +0200 Subject: [PATCH] added utils functions to clean up usage of pipe to null device everywhere in script --- config/utilities.bash | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/config/utilities.bash b/config/utilities.bash index 74deb7a..1326d79 100644 --- a/config/utilities.bash +++ b/config/utilities.bash @@ -15,4 +15,22 @@ create_sysroot() { ln -fs lib "$SYSROOT/usr/lib64" ln -fs usr/lib64 "$SYSROOT/lib64" +} + +discard_out() { + "$@" > /dev/null +} + +redirect_out() { + local path=$1; shift + "$@" > "$path" +} + +discard_all() { + "$@" > /dev/null 2>&1 +} + +redirect_all() { + local path=$1; shift + "$@" > "$path" 2>&1 } \ No newline at end of file