mirror of
https://github.com/aminnairi/dotfiles.git
synced 2026-09-14 11:02:13 +02:00
now the script will bail out if it has been provided with too much arguments
This commit is contained in:
@@ -2,9 +2,10 @@
|
||||
|
||||
ERROR_BECAUSE_ROOT=1
|
||||
ERROR_BECAUSE_NOT_ARCH_LINUX=2
|
||||
ERROR_BECAUSE_ANSIBLE_INSTALLATION_FAILED=3
|
||||
ERROR_BECAUSE_PLAYBOOK_INVALID_OR_NOT_FOUND=4
|
||||
ERROR_BECAUSE_PLAYBOOK_PATH_DOES_NOT_EXIST=5
|
||||
ERROR_BECAUSE_TOO_MUCH_ARGUMENTS_PROVDED=3
|
||||
ERROR_BECAUSE_ANSIBLE_INSTALLATION_FAILED=5
|
||||
ERROR_BECAUSE_PLAYBOOK_INVALID_OR_NOT_FOUND=5
|
||||
ERROR_BECAUSE_PLAYBOOK_PATH_DOES_NOT_EXIST=6
|
||||
|
||||
if [[ "$(id -u)" -eq 0 ]]
|
||||
then
|
||||
@@ -29,6 +30,12 @@ then
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ $# -gt 1 ]]
|
||||
then
|
||||
echo "Too much arguments provided."
|
||||
exit $ERROR_BECAUSE_TOO_MUCH_ARGUMENTS_PROVDED
|
||||
fi
|
||||
|
||||
choosen_playbook_path=$1
|
||||
|
||||
if [[ -z $choosen_playbook_path ]]
|
||||
|
||||
Reference in New Issue
Block a user