aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/util.bash5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/util.bash b/lib/util.bash
index c2429a1..7bc8a6d 100644
--- a/lib/util.bash
+++ b/lib/util.bash
@@ -18,6 +18,11 @@ chgdir() {
cd -- "$1" || die "Failed to change directory to $1"
}
+# Removes whitespace surrounding a given text.
+chomp() {
+ awk '{$1=$1};1' <<< "$@"
+}
+
# Create a datetime stamp. This is a wrapper around the date utility, ensuring
# that the date being formatted is always in UTC and respect SOURCE_DATE_EPOCH,
# if it is set.