-
Notifications
You must be signed in to change notification settings - Fork 31
/
fmt.sh
executable file
·35 lines (26 loc) · 905 Bytes
/
fmt.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
#!/bin/bash
for dir in core_lib app/legacy/src-tauri app/main/src-tauri; do
find "$dir" -name '*.rs' -not -path "*/target/*" -exec rustfmt {} +
done
# Check if there are changes in the /app/legacy/src directory
if git diff --name-only HEAD | grep '^app/legacy/src/' >/dev/null; then
echo "Changes detected in /app/legacy/src. Executing script..."
# Navigate to the app/legacy directory
cd app/legacy
# Run your commands
pnpm lint --fix
cd ../..
else
echo "No changes detected in /app/legacy/src."
fi
# Check if there are changes in the /app/main/src directory
if git diff --name-only HEAD | grep '^app/main/src/' >/dev/null; then
echo "Changes detected in /app/main/src. Executing script..."
# Navigate to the app/main directory
cd app/main
# Run your commands
pnpm lint --fix
cd ../..
else
echo "No changes detected in /app/main/src."
fi