check for 0 arguments in install.sh.

This commit is contained in:
Omar Rizwan 2020-10-30 00:50:07 -07:00
parent 52484f6e0a
commit c4245fdf7b

View file

@ -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