diff options
author | Patrick Spek <p.spek@tyil.nl> | 2023-03-10 07:37:15 +0100 |
---|---|---|
committer | Patrick Spek <p.spek@tyil.nl> | 2023-03-10 08:12:14 +0100 |
commit | f75c2d1ff9afa9646de554ac7ea1e3fe5ad121e6 (patch) | |
tree | 072c218b0b1dfb9d335d54fc45eac1625e29b5bc /lib | |
parent | 082d335fd41f5e951f3383a7bf5dfdbfdc8a93e4 (diff) |
Only show playbooks if the requisite directory exists
Diffstat (limited to 'lib')
-rw-r--r-- | lib/main.bash | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/main.bash b/lib/main.bash index afcd58d..db5832e 100644 --- a/lib/main.bash +++ b/lib/main.bash @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# SPDX-FileCopyrightText: 2022 Patrick Spek <p.spek@tyil.nl> +# SPDX-FileCopyrightText: 2023 Patrick Spek <p.spek@tyil.nl> # # SPDX-License-Identifier: AGPL-3.0-or-later @@ -103,10 +103,15 @@ Commands: playbooks. sysinfo Show gathered information about this system. var Show or set the value of a given configuration key. - -Playbooks: EOF + if [[ ! -d "$BASHTARD_ETCDIR/playbooks.d" ]] + then + return 0 + fi + + printf "\nPlaybooks:\n" + # Find all playbooks mapfile -t playbooks < <(find \ "$BASHTARD_ETCDIR/playbooks.d"/* \ |