mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-06-16 11:36:16 +08:00
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
This commit is contained in:
parent
70ad5e3df8
commit
e1920a6545
@ -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 <role name>"
|
||||
echo "Example : ansible-role-init role1"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user