Enable do.sh clippy/test for non-program crates

This commit is contained in:
Tyera Eulberg 2020-08-03 16:41:28 -06:00 committed by Michael Vines
parent 72759b37f9
commit 8c45de5340
1 changed files with 6 additions and 2 deletions

8
do.sh
View File

@ -29,6 +29,10 @@ perform_action() {
set -e set -e
projectDir="$PWD"/$2 projectDir="$PWD"/$2
targetDir="$projectDir"/target targetDir="$projectDir"/target
features=
if [[ -f "$projectDir"/Xargo.toml ]]; then
features="--features=program"
fi
case "$1" in case "$1" in
build) build)
if [[ -f "$projectDir"/Xargo.toml ]]; then if [[ -f "$projectDir"/Xargo.toml ]]; then
@ -57,7 +61,7 @@ perform_action() {
( (
cd "$projectDir" cd "$projectDir"
echo "clippy $projectDir" echo "clippy $projectDir"
cargo +nightly clippy --features=program ${@:3} cargo +nightly clippy $features ${@:3}
) )
;; ;;
doc) doc)
@ -125,7 +129,7 @@ perform_action() {
( (
cd "$projectDir" cd "$projectDir"
echo "test $projectDir" echo "test $projectDir"
cargo test --features=program ${@:3} cargo test $features ${@:3}
) )
;; ;;
update) update)