Skip to content

Commit

Permalink
tests/shell-checks: check for variables in URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
austin987 committed Oct 6, 2019
1 parent 224b6ae commit 622960b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/shell-checks
Expand Up @@ -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

0 comments on commit 622960b

Please sign in to comment.