aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <mssola@mssola.com>2026-07-06 22:46:25 +0200
committerMiquel Sabaté Solà <mssola@mssola.com>2026-07-06 22:46:25 +0200
commitbbed5ffcddcc3cf62060796baf679628687cef1d (patch)
tree93c8017f1e24469984e27390b2b7d8669819fda8
parentebaec8ac5738cf3851a0b8ea314482f00a76eec9 (diff)
downloaddotfiles-bbed5ffcddcc3cf62060796baf679628687cef1d.tar.gz
dotfiles-bbed5ffcddcc3cf62060796baf679628687cef1d.zip
kbuild: properly state when no profiles are available
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
-rwxr-xr-xbin/kbuild6
1 files changed, 5 insertions, 1 deletions
diff --git a/bin/kbuild b/bin/kbuild
index 0d61ece..87f6869 100755
--- a/bin/kbuild
+++ b/bin/kbuild
@@ -52,7 +52,11 @@ KBUILD_CONFIG_PATH="$HOME/.config/kbuild"
# Helper function to list the available profiles in the system.
list_available_profiles() {
dirs="$(find $KBUILD_CONFIG_PATH/ -mindepth 1 -maxdepth 1 -type d -printf '%P\n' | sort | awk '{printf "%s%s", (NR==1?"":", "), $0} END {print ""}')"
- echo "kbuild (info): available profiles: $dirs."
+ if [ -z "$dirs" ]; then
+ echo "kbuild (info): there are no available profiles."
+ else
+ echo "kbuild (info): available profiles: $dirs."
+ fi
}
##