Skip to content

Commit b4d57bf

Browse files
committed
Add better error message if readme is out of sync
Also move files into own folder. Remove this test branch from the travis
1 parent 9f0dc79 commit b4d57bf

File tree

5 files changed

+16
-4
lines changed

5 files changed

+16
-4
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
/target
22
**/*.rs.bk
33
Cargo.lock
4-
README.md.expected

.travis.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ before_install:
1414
branches:
1515
only:
1616
- master
17-
- fix/28-cargo-readme
1817

1918
cache:
2019
directories:
@@ -72,8 +71,7 @@ matrix:
7271
before_script:
7372
- bash update_cargo-readme.sh
7473
script:
75-
- cargo readme > README.md.expected
76-
- diff README.md README.md.expected
74+
- bash auxiliary/check_readme_consistency.sh
7775

7876
script: |
7977
export RUST_BACKTRACE=1 &&
File renamed without changes.

auxiliary/check_readme_consistency.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/usr/bin/bash
2+
3+
cargo readme --template auxiliary/README.tpl > README.md.expected
4+
5+
diff README.md README.md.expected
6+
7+
if [ $? -eq 0 ]
8+
then
9+
echo 'README.md is up to date!'
10+
exit 0
11+
else
12+
echo 'README.md out of date. Run "cargo readme > README.md" and commit again.'
13+
exit 1
14+
fi

update_cargo-readme.sh renamed to auxiliary/update_cargo-readme.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/usr/bin/bash
2+
23
our_version=$(cargo readme -V | perl -ne 'print $1 while /v([\d.]+)/g')
34
last_version=$(cargo search cargo-readme | perl -ne 'print $1 while /^cargo-readme = "([\d.]+)"/g')
45

0 commit comments

Comments
 (0)