Fix regex, also install cargo-update with trust

pull/116/head
James Munns 5 years ago
parent de62620460
commit eba85c3ede

@ -18,7 +18,7 @@ matrix:
before_script:
- rustup component add rustfmt
- (test -x $HOME/.cargo/bin/cargo-install-update || cargo install cargo-update)
- (test -x $HOME/.cargo/bin/cargo-install-update || ./ci/install-cargo-update.sh)
- (test -x $HOME/.cargo/bin/mdbook || ./ci/install-mdbook.sh)
- cargo install-update -a

@ -0,0 +1,19 @@
set -euxo pipefail
# Based on the Rust-Embedded WG's book CI
# https://github.com/rust-embedded/book/blob/master/ci/install.sh
main() {
# Note - this will accept any tagged release
local tag=$(git ls-remote --tags --refs --exit-code \
https://github.com/nabijaczleweli/cargo-update \
| cut -d/ -f3 \
| grep -E '^v[0-9\.]+$' \
| sort --version-sort \
| tail -n1)
curl -LSfs https://japaric.github.io/trust/install.sh | \
sh -s -- --git nabijaczleweli/cargo-update --tag $tag
}
main

@ -8,7 +8,7 @@ main() {
local tag=$(git ls-remote --tags --refs --exit-code \
https://github.com/rust-lang-nursery/mdbook \
| cut -d/ -f3 \
| grep -E '^v0.3.[0-9]+$' \
| grep -E '^v0\.3\.[0-9]+$' \
| sort --version-sort \
| tail -n1)

Loading…
Cancel
Save