Skip to content

Commit 5fe6f29

Browse files
author
Dmitriy Rabotyagov
committed
Ensure bash-completion also search for .yaml
Auto-complete ignores playbooks having .yaml extension, which might be a good chunk of third-party playbooks. Let's ensure we cover them as well. Change-Id: If995d702ea58c4251b655ba2c3043dbf4f14e671 Signed-off-by: Dmitriy Rabotyagov <dmitriy.rabotyagov@cleura.com>
1 parent 4f7c175 commit 5fe6f29

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

scripts/bash-completion

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ _normalize_collection_playbook_paths(){
4242

4343
# Remove ".yml" extension (if present)
4444
path=${path%.yml}
45+
path=${path%.yaml}
4546

4647
# Replace slashes with dots
4748
path=${path//\//.}
@@ -83,7 +84,7 @@ _openstack_ansible() {
8384
elif [[ "$prev" == "-l" ]] || [[ "$prev" == "--limit" ]]; then
8485
completions=$(_ansible_hosts_inventory | grep -i "${cur}")
8586
else
86-
playbooks=$(find ${COLLECTION_PATH} -type f -name "*.yml" | grep playbooks)
87+
playbooks=$(find ${COLLECTION_PATH} -type f \( -name "*.yml" -o -name "*.yaml" \) | grep playbooks)
8788
completions=$(_normalize_collection_playbook_paths ${playbooks[@]} | grep -i "${cur}")
8889
fi
8990
COMPREPLY=($(compgen -W '${completions}' -- ${cur}))

0 commit comments

Comments
 (0)