Skip to content

Commit

Permalink
Disable false positive ShellCheck warnings SC2154
Browse files Browse the repository at this point in the history
ShellCheck thinks these variables are unused. However, one of the
exceptions applies here:

> ShellCheck does not attempt to figure out runtime or dynamic
> assignments like with source mycommonvars.sh or eval var=value.

${useragent[$uakey]} in line 337 references these variables.
  • Loading branch information
neverpanic committed Jul 2, 2015
1 parent 514075a commit c839b01
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions google-font-download
Expand Up @@ -241,9 +241,14 @@ fi

# Store the useragents we're going to use to trick Google's servers into serving us the correct CSS file.
declare -A useragent
# ShellCheck doesn't correctly notice our dynamic use of these variables.
# shellcheck disable=SC2154
useragent[eot]='Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0)'
# shellcheck disable=SC2154
useragent[woff]='Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0'
# shellcheck disable=SC2154
useragent[svg]='Mozilla/4.0 (iPad; CPU OS 4_0_1 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/4.1 Mobile/9A405 Safari/7534.48.3'
# shellcheck disable=SC2154
useragent[ttf]='Mozilla/5.0 (Windows NT 6.1) AppleWebKit/534.54.16 (KHTML, like Gecko) Version/5.1.4 Safari/534.54.16'

# Clear the output file
Expand Down

0 comments on commit c839b01

Please sign in to comment.