aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md5
-rw-r--r--lib/main.bash12
2 files changed, 16 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 157dc0e..ebc7f0f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -23,6 +23,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
remove registry entries when a playbook itself has been deleted or is
otherwise broken in a way that the regular `del` subcommand cannot fix.
+### Changed
+
+- The `description.txt` is now allowed to be used without the `.txt` suffix.
+ Usage with the `.txt` suffix continues to be supported as well.
+
### Fixed
- Passing an empty string as default value to `config` should now properly
diff --git a/lib/main.bash b/lib/main.bash
index 196bbbf..821c2d2 100644
--- a/lib/main.bash
+++ b/lib/main.bash
@@ -138,9 +138,19 @@ EOF
# Render playbook descriptions
for playbook in "${playbooks[@]}"
do
+ local description=""
+
+ if [[ -f "$playbook/description.txt" ]]
+ then
+ description="$(cat "$playbook/description.txt")"
+ elif [[ -f "$playbook/description" ]]
+ then
+ description="$(cat "$playbook/description")"
+ fi
+
printf "\t%-${playbook_longest}s %s\n" \
"$(basename "$playbook")" \
- "$(cat "$playbook/description.txt")"
+ "$description"
done
}