Merge branch 'busybox' of https://github.com/austin987/shellcheck into austin987-busybox

This commit is contained in:
Vidar Holen 2021-03-11 21:44:17 -08:00
commit ea83b602d7
2 changed files with 11 additions and 4 deletions

View File

@ -590,6 +590,12 @@ prop_checkShebang9 = verifyNotTree checkShebang "# shellcheck shell=sh\ntrue"
prop_checkShebang10= verifyNotTree checkShebang "#!foo\n# shellcheck shell=sh ignore=SC2239\ntrue" prop_checkShebang10= verifyNotTree checkShebang "#!foo\n# shellcheck shell=sh ignore=SC2239\ntrue"
prop_checkShebang11= verifyTree checkShebang "#!/bin/sh/\ntrue" prop_checkShebang11= verifyTree checkShebang "#!/bin/sh/\ntrue"
prop_checkShebang12= verifyTree checkShebang "#!/bin/sh/ -xe\ntrue" prop_checkShebang12= verifyTree checkShebang "#!/bin/sh/ -xe\ntrue"
prop_checkShebang13= verifyTree checkShebang "#!/bin/busybox sh"
prop_checkShebang14= verifyTree checkShebang "#!/bin/busybox sh\n# shellcheck shell=sh\n"
prop_checkShebang15= verifyNotTree checkShebang "#!/bin/busybox sh\n# shellcheck shell=dash\n"
prop_checkShebang16= verifyTree checkShebang "#!/bin/busybox ash"
prop_checkShebang17= verifyNotTree checkShebang "#!/bin/busybox ash\n# shellcheck shell=dash\n"
prop_checkShebang18= verifyNotTree checkShebang "#!/bin/busybox ash\n# shellcheck shell=sh\n"
checkShebang params (T_Annotation _ list t) = checkShebang params (T_Annotation _ list t) =
if any isOverride list then [] else checkShebang params t if any isOverride list then [] else checkShebang params t
where where

View File

@ -3237,10 +3237,11 @@ readScriptFile sourced = do
case words sb of case words sb of
[] -> "" [] -> ""
[x] -> basename x [x] -> basename x
(first:args) -> (first:args) | basename first == "env" ->
if basename first == "env" fromMaybe "" $ find (notElem '=') $ skipFlags args
then fromMaybe "" $ find (notElem '=') $ skipFlags args (first:second:args) | basename first == "busybox" ->
else basename first second
(first:_) -> basename first
verifyShebang pos s = do verifyShebang pos s = do
case isValidShell s of case isValidShell s of