diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2018-07-31 21:12:25 -0700 |
---|---|---|
committer | Matthias Beyer <mail@beyermatthias.de> | 2018-08-26 04:24:57 +0200 |
commit | 2fa5b2f4bd2ee5d011a83c480a0a9eb278aa5814 (patch) | |
tree | 0a43b90c6e03be5ffe88b655bf04bf95fbe524b3 /scripts | |
parent | ea77faeae28ef5288f586d443e05ebe8665700e7 (diff) |
Add script to check whether binaries are named correctly
It is a simple approach but it works: Read the name of the binary from
the Cargo.toml file and check whether the name appears in the path.
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/check-binary-names | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/scripts/check-binary-names b/scripts/check-binary-names new file mode 100644 index 00000000..075c0736 --- /dev/null +++ b/scripts/check-binary-names @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +for file in `find bin -type f -name Cargo.toml -o -name main.rs -o -name ui.rs`; +do + echo "$file" | grep Cargo.toml > /dev/null 2>/dev/null && { + name=$(cat $file | grep description | sed 's,.*: ,,; s, .*,,') + + echo "$file" | grep "$name" > /dev/null 2>/dev/null || { + echo "Crate in $file is named $name" + exit 1 + } + } + +done |