swetoast / steamlink-launcher

Steamlink launcher for OSMC
GNU General Public License v2.0
157 stars 19 forks source link

fix: too many arguments #45

Closed regseb closed 2 years ago

regseb commented 2 years ago

When I start Steamlink Launcher, I get the errors:

/tmp/steamlink-watchdog.sh: line 3: [: too many arguments
/tmp/steamlink-watchdog.sh: line 7: [: too many arguments
/tmp/steamlink-watchdog.sh: line 11: [: too many arguments
/tmp/steamlink-watchdog.sh: line 15: [: too many arguments
/tmp/steamlink-watchdog.sh: line 19: [: too many arguments

Environment

ii  gnupg                                2.2.27-2+deb11u1               all          GNU privacy guard - a free PGP replacement
ii  gnupg-l10n                           2.2.27-2+deb11u1               all          GNU privacy guard - localization files
ii  gnupg-utils                          2.2.27-2+deb11u1               armhf        GNU privacy guard - utility programs

Solution

ShellCheck reports SC2046 and SC2143.

Line 3:
if [ ! $(dpkg --list | grep gnupg) ]; then
       ^-- SC2046 (warning): Quote this to prevent word splitting.
       ^-- SC2143 (style): Use grep -q instead of comparing output with [ -n .. ].

Line 7:
if [ ! $(dpkg --list | grep curl) ]; then
       ^-- SC2046 (warning): Quote this to prevent word splitting.
       ^-- SC2143 (style): Use grep -q instead of comparing output with [ -n .. ].

Line 11:
if [ ! $(dpkg --list | grep libgles2) ]; then
       ^-- SC2046 (warning): Quote this to prevent word splitting.
       ^-- SC2143 (style): Use grep -q instead of comparing output with [ -n .. ].

Line 15:
if [ ! $(dpkg --list | grep libegl1) ]; then
       ^-- SC2046 (warning): Quote this to prevent word splitting.
       ^-- SC2143 (style): Use grep -q instead of comparing output with [ -n .. ].

Line 19:
if [ ! $(dpkg --list | grep libgl1-mesa-dri) ]; then
       ^-- SC2046 (warning): Quote this to prevent word splitting.
       ^-- SC2143 (style): Use grep -q instead of comparing output with [ -n .. ].
swetoast commented 2 years ago

tnx merged it :)