aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/kiss-cargo-urlgen8
1 files changed, 6 insertions, 2 deletions
diff --git a/contrib/kiss-cargo-urlgen b/contrib/kiss-cargo-urlgen
index ba14aa9..9174edc 100755
--- a/contrib/kiss-cargo-urlgen
+++ b/contrib/kiss-cargo-urlgen
@@ -1,11 +1,15 @@
#!/bin/sh
[ "$1" ] || {
- printf 'usage: kiss-carg-urlgen [crate-ver] [crate-ver]\n'
+ printf 'usage: kiss-carg-urlgen [crate+ver] [crate+ver]\n'
exit 1
}
+# We convert the name-version seperator from '+' to '-' to
+# avoid issues that may arise from version numbers that include
+# a '-'.
+
for crate in "$@"; do
printf 'https://static.crates.io/crates/%s/%s.crate vendor\n' \
- "${crate%-*}" "$crate"
+ "${crate%+*}" "$(echo "$crate" | sed 's/+/-/')"
done