|
1 | 1 | #!/bin/sh |
2 | 2 |
|
3 | | -if [ ! -e tmp/Cargo.toml ]; then |
4 | | - if [ ! -d tmp ]; then |
5 | | - cargo new tmp |
6 | | - else |
7 | | - cargo init tmp |
8 | | - fi |
9 | | - cat >> tmp/Cargo.toml <<-EOF |
10 | | -futures = "0.3" |
11 | | -hyper = { version = "0.14", features = ["full"] } |
12 | | -hyper-tls = "0.5" |
13 | | -tokio = { version = "1", features = ["full"] } |
| 3 | +for value in legacy master |
| 4 | +do |
| 5 | + if [ ! -e "$value/Cargo.toml" ]; then |
| 6 | + if [ ! -d $value ]; then |
| 7 | + cargo new $value |
| 8 | + else |
| 9 | + cargo init $value |
| 10 | + fi |
| 11 | + if [ $value = legacy ]; then |
| 12 | + cat >> "$value/Cargo.toml" <<-EOF |
| 13 | + futures = "0.3" |
| 14 | + hyper = { version = "0.14", features = ["full"] } |
| 15 | + hyper-tls = "0.5" |
| 16 | + tokio = { version = "1", features = ["full"] } |
14 | 17 | EOF |
15 | | - cargo build --manifest-path tmp/Cargo.toml |
16 | | -fi |
17 | | - |
18 | | -test_file() { |
19 | | - echo "Testing: $f" |
20 | | - rustdoc --edition 2018 --test $1 -L tmp/target/debug/deps |
21 | | -} |
22 | | - |
23 | | -if [ -n "$1" ]; then |
24 | | - test_file $1 |
25 | | - exit $? |
26 | | -fi |
| 18 | + cargo build --manifest-path "$value/Cargo.toml" |
| 19 | + fi |
| 20 | + if [ $value = master ]; then |
| 21 | + cat >> "$value/Cargo.toml" <<-EOF |
| 22 | + hyper = { version = "1.0.0-rc.1", features = ["full"] } |
| 23 | + tokio = { version = "1", features = ["full"] } |
| 24 | + http-body-util = "0.1.0-rc.1" |
| 25 | +EOF |
| 26 | + cargo build --manifest-path "$value/Cargo.toml" |
| 27 | + fi |
| 28 | + fi |
| 29 | + test_file() { |
| 30 | + echo "Testing: $f" |
| 31 | + rustdoc --edition 2018 --test $1 -L "$value/target/debug/deps" |
| 32 | + } |
27 | 33 |
|
28 | | -status=0 |
29 | | -for f in `git ls-files | grep '\.md$'`; do |
30 | | - test_file $f |
31 | | - s=$? |
32 | | - if [ "$s" != "0" ]; then |
33 | | - status=$s |
| 34 | + if [ -n "$1" ]; then |
| 35 | + test_file $1 |
| 36 | + exit $? |
34 | 37 | fi |
| 38 | + |
| 39 | + status=0 |
| 40 | + for f in `git ls-files | grep "^_guides\/$value.*\.md$"`; do |
| 41 | + test_file $f |
| 42 | + s=$? |
| 43 | + if [ "$s" != "0" ]; then |
| 44 | + status=$s |
| 45 | + fi |
| 46 | + done |
35 | 47 | done |
36 | 48 |
|
37 | 49 | exit $status |
0 commit comments