grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH V2 3/4] bash-completion:fix shellcheck SC2155-Warning


From: t . feng
Subject: [PATCH V2 3/4] bash-completion:fix shellcheck SC2155-Warning
Date: Wed, 30 Nov 2022 16:30:59 +0800

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)

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

Signed-off-by: "t.feng" <fengtao40@huawei.com>
---
 util/bash-completion.d/grub-completion.bash.in | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/util/bash-completion.d/grub-completion.bash.in 
b/util/bash-completion.d/grub-completion.bash.in
index 4749cbc64..d5250c179 100644
--- a/util/bash-completion.d/grub-completion.bash.in
+++ b/util/bash-completion.d/grub-completion.bash.in
@@ -115,7 +115,8 @@ __grub_get_last_option () {
 
 __grub_list_menuentries () {
     local cur="${COMP_WORDS[COMP_CWORD]}"
-    local config_file=$(__grub_dir)/grub.cfg
+    local config_file
+    config_file=$(__grub_dir)/grub.cfg
 
     if [ -f "$config_file" ];then
         local IFS=$'\n'
@@ -129,7 +130,8 @@ __grub_list_menuentries () {
 }
 
 __grub_list_modules () {
-    local grub_dir=$(__grub_dir)
+    local grub_dir
+    grub_dir=$(__grub_dir)
     local IFS=$'\n'
     COMPREPLY=()
     while read -r line; do
-- 
2.27.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]