mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-08-07 06:08:39 +02: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 changed files with 5 additions and 5 deletions
|
|
@ -1,13 +1,13 @@
|
||||||
# Functions
|
# Functions
|
||||||
function ansible-version(){
|
function ansible-version() {
|
||||||
ansible --version
|
ansible --version
|
||||||
}
|
}
|
||||||
|
|
||||||
function ansible-role-init(){
|
function ansible-role-init() {
|
||||||
if ! [ -z $1 ] ; then
|
if [[ -n "$1" ]]; then
|
||||||
echo "Ansible Role : $1 Creating...."
|
echo "Ansible Role : $1 Creating...."
|
||||||
ansible-galaxy init $1
|
ansible-galaxy init "$1"
|
||||||
tree $1
|
tree "$1"
|
||||||
else
|
else
|
||||||
echo "Usage : ansible-role-init <role name>"
|
echo "Usage : ansible-role-init <role name>"
|
||||||
echo "Example : ansible-role-init role1"
|
echo "Example : ansible-role-init role1"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue