Last active
July 21, 2026 08:06
-
-
Save lqd/4a8af10389d10840d90655c109df5eac to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| __printusage() { | |
| echo "Usage: $1 <crate> <version> | <crate>-<version>" | |
| echo "" | |
| echo "e.g. $1 conrod 0.32.0" | |
| } | |
| if [[ "$#" == 2 ]]; then | |
| _crate=$1 | |
| _version=$2 | |
| elif [[ "$1" =~ .+-([0-9]+(\.)?)+$ ]]; then | |
| _crate=${1%-*} | |
| _version=${1##*-} | |
| else | |
| __printusage $0 | |
| exit 1 | |
| fi | |
| # described in https://crates.io/data-access#crate-content | |
| curl -L https://static.crates.io/crates/$_crate/$_crate-$_version.crate | tar zxf - |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment