aurora / rmate

Remote TextMate 2 implemented as shell script
GNU General Public License v3.0
887 stars 123 forks source link

resolve array issues reported by shellcheck #55

Closed mobilemind closed 7 years ago

mobilemind commented 7 years ago

shellcheck utility identified 3 issues relating to use of arrays in rmate. This PR attempts to resolve them. Proposed resolution is a "$filepaths[*]" array expansion in the first case and use of array assignment filepaths=('-') for the second 2 cases.

The snippet below shows the issues as reported by shellcheck v 0.4.6.

shellcheck rmate | grep -E -B 4 'SC21[27]8'

In rmate line 212:
if [ "$filepaths" = "" ]; then
      ^-- SC2128: Expanding an array without an index only gives the first element.
--
In rmate line 214:
        filepaths='-'
        ^-- SC2178: Variable was used as an array but is now assigned a string.
--
In rmate line 222:
                filepaths='-'
                ^-- SC2178: Variable was used as an array but is now assigned a string.
aurora commented 7 years ago

Thanks!