Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions uls-fetch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ main() {

al_type="${fn#*_}"
al_type="${al_type%%_*}"
al_type="${al_type%%.info}"
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch on the suffix removal.

Could this be changed to either shortest-trailing, %.info or longest-trailing %%.* instead? A non-glob string won't benefit from longest-match. Between the above options, a glob makes it easier for alternative suffixes to be used in the future (like .info.txt) but may impair meaning as this is already hard-coded elsewhere. Either works for me as more direct, though.

kind="${fn%%_*}"
if [ "$kind" = "weekly" ]; then
args="$args -W $al_type"
Expand Down