Skip to content

Commit eba85c3

Browse files
author
James Munns
committed
Fix regex, also install cargo-update with trust
1 parent de62620 commit eba85c3

File tree

3 files changed

+21
-2
lines changed

3 files changed

+21
-2
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ matrix:
1818

1919
before_script:
2020
- rustup component add rustfmt
21-
- (test -x $HOME/.cargo/bin/cargo-install-update || cargo install cargo-update)
21+
- (test -x $HOME/.cargo/bin/cargo-install-update || ./ci/install-cargo-update.sh)
2222
- (test -x $HOME/.cargo/bin/mdbook || ./ci/install-mdbook.sh)
2323
- cargo install-update -a
2424

ci/install-cargo-update.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
set -euxo pipefail
2+
3+
# Based on the Rust-Embedded WG's book CI
4+
# https://github.com/rust-embedded/book/blob/master/ci/install.sh
5+
6+
main() {
7+
# Note - this will accept any tagged release
8+
local tag=$(git ls-remote --tags --refs --exit-code \
9+
https://github.com/nabijaczleweli/cargo-update \
10+
| cut -d/ -f3 \
11+
| grep -E '^v[0-9\.]+$' \
12+
| sort --version-sort \
13+
| tail -n1)
14+
15+
curl -LSfs https://japaric.github.io/trust/install.sh | \
16+
sh -s -- --git nabijaczleweli/cargo-update --tag $tag
17+
}
18+
19+
main

ci/install-mdbook.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ main() {
88
local tag=$(git ls-remote --tags --refs --exit-code \
99
https://github.com/rust-lang-nursery/mdbook \
1010
| cut -d/ -f3 \
11-
| grep -E '^v0.3.[0-9]+$' \
11+
| grep -E '^v0\.3\.[0-9]+$' \
1212
| sort --version-sort \
1313
| tail -n1)
1414

0 commit comments

Comments
 (0)