[X2Go-Commits] [nx-libs] 225/429: shellcheck: Fix SC2045 issue

git-admin at x2go.org git-admin at x2go.org
Mon Oct 18 09:36:38 CEST 2021


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch 3.6.x
in repository nx-libs.

commit 2168bc68987c0d47f5898040ead57484d2671fb7
Author: Mario Trangoni <mjtrangoni at gmail.com>
Date:   Sun Jan 31 14:43:47 2021 +0100

    shellcheck: Fix SC2045 issue
    
    See,
    
    $ find . -name "*.sh" | xargs shellcheck -i SC2045
    
    In ./roll-tarballs.sh line 220:
    for f in $(ls README* 2>/dev/null); do
             ^-----------------------^ SC2045: Iterating over ls output is fragile. Use globs.
    
    For more information:
      https://www.shellcheck.net/wiki/SC2045 -- Iterating over ls output is fragi...
    
    Signed-off-by: Mario Trangoni <mjtrangoni at gmail.com>
---
 roll-tarballs.sh | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/roll-tarballs.sh b/roll-tarballs.sh
index 85e098960..5d0b7c215 100755
--- a/roll-tarballs.sh
+++ b/roll-tarballs.sh
@@ -217,8 +217,9 @@ rm -Rf "debian/"
 rm -Rf "nx-libs.spec"
 
 # very old release did not add any README
-for f in $(ls README* 2>/dev/null); do
-    mv -v "$f" "doc/";
+for f in README*; do
+    [[ -e "$f" ]] || break # handle the case of no README* files
+    mv -v "$f" "doc/"
 done
 
 # remove files, that we do not want in the tarballs (build cruft)

--
Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/nx-libs.git


More information about the x2go-commits mailing list