From e1920a6545198527b1f91ed770e5d6f836abaf4e Mon Sep 17 00:00:00 2001 From: fauzan171 Date: Sat, 6 Jun 2026 23:29:08 +0700 Subject: [PATCH] fix(ansible): use zsh-style conditionals and quote variables - Replace bash-style `! [ -z $1 ]` with zsh-native `[[ -n "$1" ]]` - Quote $1 variable in ansible-galaxy init and tree calls to handle role names with spaces correctly - Add missing space before function parentheses for consistent style --- plugins/ansible/ansible.plugin.zsh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/ansible/ansible.plugin.zsh b/plugins/ansible/ansible.plugin.zsh index 75393b704..bfe7f8cb4 100644 --- a/plugins/ansible/ansible.plugin.zsh +++ b/plugins/ansible/ansible.plugin.zsh @@ -1,13 +1,13 @@ # Functions -function ansible-version(){ +function ansible-version() { ansible --version } -function ansible-role-init(){ - if ! [ -z $1 ] ; then +function ansible-role-init() { + if [[ -n "$1" ]]; then echo "Ansible Role : $1 Creating...." - ansible-galaxy init $1 - tree $1 + ansible-galaxy init "$1" + tree "$1" else echo "Usage : ansible-role-init " echo "Example : ansible-role-init role1"