Skip to content

Commit

Permalink
refactor: make releases grep line more robust
Browse files Browse the repository at this point in the history
Header files are not always consistent in their format.
'Location' can sometimes be capitalized, hence the '-i'

Regex can too easily turn into lines of indecipherable hieroglyphics  but in this case, due to variance as cited above, regex would probably be more robust than grepping for 'location:' (with a colon)  and if the header was reorganised then '-m 1' could end up up failing.
  • Loading branch information
TuxVinyards committed Oct 19, 2024
1 parent 4d56e12 commit 503e083
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion quickget
Original file line number Diff line number Diff line change
Expand Up @@ -828,7 +828,7 @@ function releases_manjaro() {

function releases_mxlinux() {
# needs header, so not web_pipe:
curl -Ils "https://sourceforge.net/projects/mx-linux/files/latest/download" | grep -i -m 1 'location' | cut -d? -f1 | cut -d_ -f1 | cut -d- -f3
curl -Ils "https://sourceforge.net/projects/mx-linux/files/latest/download" | grep -i -E ^'location' | cut -d? -f1 | cut -d_ -f1 | cut -d- -f3
}

function editions_mxlinux() {
Expand Down

0 comments on commit 503e083

Please sign in to comment.