-
Notifications
You must be signed in to change notification settings - Fork 0
/
update-readme.sh
executable file
·42 lines (37 loc) · 1.03 KB
/
update-readme.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/env bash
set -e
usage() {
echo "$(basename "$0"): ERROR: $1" >&2
echo "usage: $(basename "$0") [--filename FILENAME]" >&2
exit 1
}
filename=Readme.md
while [ $# -gt 0 ]; do
case "$1" in
--filename)
shift
[ -n "$1" ] || usage "missing parameter to --filename argument"
filename="$1"
;;
*) usage "bad argument '$1'" ;;
esac
shift
done
echo "PWD=$(pwd)"
set -x
cargo readme --no-title --no-indent-headings >"$filename"
set +x
if grep --quiet 'Cargo Geiger Safety Report' src/main.rs; then
time (
# "--target not used?"
# https://github.com/rust-secure-code/cargo-geiger/issues/95
# Remove once cargo-geiger stops failing with:
# WARNING: Dependency file was never scanned: /Users/user/deduposaur/target/debug/build/rustversion-aa26b2894066e33c/out/version.rs
# error: Found 1 warnings
set +e
set -x
cargo geiger --all-features --update-readme --readme-path "$filename" --output-format GitHubMarkdown --build-dependencies
set +x
echo -n "cargo geiger done."
)
fi