From 622960b1f82f0153f539a4451d444cb0b62c806c Mon Sep 17 00:00:00 2001 From: Austin English Date: Sun, 6 Oct 2019 11:56:20 -0500 Subject: [PATCH] tests/shell-checks: check for variables in URLs --- tests/shell-checks | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/shell-checks b/tests/shell-checks index 3db977588..c5f27a20a 100755 --- a/tests/shell-checks +++ b/tests/shell-checks @@ -118,3 +118,10 @@ for shellscript in $files_to_check; do # E044=Use [[ for non-POSIX comparisions w_try "$bashate" -i E006,E010,E044 "${shellscript}" done + +# Check for uses of variables in w_download when w_linkcheck_ignore isn't set +# Using w_download https://example.com/${file1} breaks src/linkcheck.sh +# FIXME: technically '$' is valid in a URL, if there's actually a URL using it this will need a tweak +if grep "^ *w_download " src/winetricks | grep -E "ftp|http" | grep -v "w_linkcheck_ignore=1" | sed "s/^ *//" | tr -d "\\\\" | cut -d " " -f2 | grep "\\$"; then + w_die "Do not use variables in URLs, it breaks src/linkcheck.sh" +fi