diff options
author | Omar Rizwan <omar.rizwan@gmail.com> | 2020-10-30 00:50:07 -0700 |
---|---|---|
committer | Omar Rizwan <omar.rizwan@gmail.com> | 2020-10-30 00:50:07 -0700 |
commit | c4245fdf7b907a3ba48b15be8a422dabb6d8b32c (patch) | |
tree | ebf7c05a17d2c9328ac6b1f9e14dd7466140d7fb /install.sh | |
parent | 52484f6e0ab30e53986e863e31ac60703e52800d (diff) |
check for 0 arguments in install.sh.
Diffstat (limited to 'install.sh')
-rwxr-xr-x | install.sh | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -1,8 +1,9 @@ #!/bin/bash -eux -if [[ ! ( ( "$1" == "firefox" && "$#" -eq 1 ) || - ( "$1" == "chrome" && "$#" -eq 2 && ${#2} -eq 32 ) || - ( "$1" == "chromium" && "$#" -eq 2 && ${#2} -eq 32 ) ) ]]; then +if [[ "$#" -lt 1 || ( + ! ( ( "$1" == "firefox" && "$#" -eq 1 ) || + ( "$1" == "chrome" && "$#" -eq 2 && ${#2} -eq 32 ) || + ( "$1" == "chromium" && "$#" -eq 2 && ${#2} -eq 32 ) ) ) ]]; then echo "Usage: $0 <chrome EXTENSION_ID | chromium EXTENSION_ID | firefox>" exit 2 fi |