2023-10-13 12:52:06 +03:00
|
|
|
#!/bin/bash
|
|
|
|
|
2023-10-17 11:21:00 +03:00
|
|
|
set -o errexit
|
|
|
|
set -o nounset
|
|
|
|
set -o pipefail
|
2023-10-16 17:23:53 +03:00
|
|
|
|
2023-10-17 11:21:00 +03:00
|
|
|
function rust() {
|
|
|
|
cargo fmt --check
|
|
|
|
cargo sort -c -w
|
2023-11-24 11:03:04 +03:00
|
|
|
cargo clippy --all-targets --all-features --tests
|
2023-10-17 11:21:00 +03:00
|
|
|
cargo test
|
|
|
|
}
|
2023-10-16 17:23:53 +03:00
|
|
|
|
2023-10-17 11:21:00 +03:00
|
|
|
function node() {
|
|
|
|
pnpm lint
|
|
|
|
pnpm check
|
|
|
|
}
|
2023-10-16 17:23:53 +03:00
|
|
|
|
2023-10-17 11:21:00 +03:00
|
|
|
if [[ "$#" -eq 0 ]]; then
|
|
|
|
set -o xtrace
|
|
|
|
rust
|
|
|
|
node
|
|
|
|
else
|
|
|
|
case "$1" in
|
|
|
|
rust)
|
|
|
|
set -o xtrace
|
|
|
|
rust
|
|
|
|
;;
|
|
|
|
node)
|
|
|
|
set -o xtrace
|
|
|
|
node
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "Invalid argument: $1"
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
exit 0
|
|
|
|
fi
|