]> git.ipfire.org Git - thirdparty/grub.git/commit
util/bash-completion: Fix SC2155 shellcheck warning
authort.feng <fengtao40@huawei.com>
Tue, 6 Dec 2022 13:49:30 +0000 (21:49 +0800)
committerDaniel Kiper <daniel.kiper@oracle.com>
Wed, 7 Dec 2022 22:38:27 +0000 (23:38 +0100)
commite9802fbdeb5ce94aaa8f0acf955778b9167c3158
tree5a571eff8a308fb150297ee1bf4d4e9f77fe3725
parent61e4f408b08d49c24cc2f183078ef687cf8e5bc5
util/bash-completion: Fix SC2155 shellcheck warning

SC2155 (warning): Declare and assign separately to avoid masking return values.

The exit status of the command is overridden by the exit status of the
creation of the local variable.

In grub-completion.bash.in line 115:
    local config_file=$(__grub_dir)/grub.cfg
          ^---------^ SC2155 (warning)

In grub-completion.bash.in line 126:
    local grub_dir=$(__grub_dir)
          ^------^ SC2155 (warning)

More: https://github.com/koalaman/shellcheck/wiki/SC2155

Signed-off-by: t.feng <fengtao40@huawei.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
util/bash-completion.d/grub-completion.bash.in