Skip to content

Commit 7c1d436

Browse files
committed
Only show os/arch when constraints requested
1 parent d451b48 commit 7c1d436

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

gh-program-downloader

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,22 @@ find_artifact() {
5050
select_artifact() {
5151
artifact=$(find_artifact)
5252
if [ -z "$artifact" ]; then
53-
echo "$0 could not find asset from '$releases_url' (saved as '$releases') matching OS ('$os_re') and ARCH ('$arch_re')" >&2
53+
if [ -n "$os_re" ]; then
54+
os_message="OS ('$os_re')"
55+
maybe_and=1
56+
matching=1
57+
fi
58+
if [ -n "$arch_re" ]; then
59+
arch_message="ARCH ('$arch_re')"
60+
if [ -n "$maybe_and" ]; then
61+
and=' and '
62+
fi
63+
matching=1
64+
fi
65+
if [ -n "$matching" ]; then
66+
matching='matching '
67+
fi
68+
echo "$0 could not find asset from '$releases_url' (saved as '$releases') ${matching}${os_message}${and}${arch_message}" >&2
5469
exit 1
5570
fi
5671
}

0 commit comments

Comments
 (0)