mirror of
https://github.com/aminnairi/dotfiles.git
synced 2026-09-14 15:42:14 +02:00
now allowing the user to choose the playbook path only if no arguments
has been provided
This commit is contained in:
@@ -28,6 +28,10 @@ then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
choosen_playbook_path=$1
|
||||||
|
|
||||||
|
if [[ -z $choosen_playbook_path ]]
|
||||||
|
then
|
||||||
echo "Choose a configuration";
|
echo "Choose a configuration";
|
||||||
|
|
||||||
available_playbooks="$(ls ansible/*.yml)"
|
available_playbooks="$(ls ansible/*.yml)"
|
||||||
@@ -48,6 +52,7 @@ done
|
|||||||
read -r -p "Choice: " index
|
read -r -p "Choice: " index
|
||||||
|
|
||||||
choosen_playbook_path=${available_playbook_paths[$index - 1]}
|
choosen_playbook_path=${available_playbook_paths[$index - 1]}
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ -z $choosen_playbook_path ]]
|
if [[ -z $choosen_playbook_path ]]
|
||||||
then
|
then
|
||||||
|
|||||||
Reference in New Issue
Block a user