prettify scripts

This commit is contained in:
Nikita Galaiko 2023-10-17 10:21:00 +02:00 committed by GitButler
parent 29e4c90d12
commit 5cf3fd931e
3 changed files with 69 additions and 23 deletions

View File

@ -1,17 +1,39 @@
#!/bin/bash
echo ------ cargo check
cargo c --all-features
set -o errexit
set -o nounset
set -o pipefail
echo ------ cargo clippy
cargo clippy --all-features
cargo clippy --tests
echo ------ cargo test
cargo t
echo ------ cargo fmt
function rust() {
cargo fmt --check
echo ------ cargo sort
cargo sort -c -w
cargo clippy --all-features --tests
cargo test
}
function node() {
pnpm lint
pnpm check
}
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

View File

@ -1,11 +0,0 @@
#!/bin/bash
# Run pnpm format
pnpm format
# Change directory to src-tauri
cd src-tauri
# Run cargo fmt
cargo fmt

35
scripts/format.sh Executable file
View File

@ -0,0 +1,35 @@
#!/bin/bash
set -o errexit
set -o nounset
set -o pipefail
function rust() {
cargo fmt
}
function node() {
pnpm format
}
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