-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclean.sh
More file actions
86 lines (72 loc) · 1.87 KB
/
Copy pathclean.sh
File metadata and controls
86 lines (72 loc) · 1.87 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#!/bin/bash
echo "=================================================="
echo " Requiem Project Cleanup Script (Linux) "
echo "=================================================="
echo
# Verify if we are in the root directory of the project
if [ ! -f pubspec.yaml ]; then
echo "[ERROR] pubspec.yaml not found."
echo "Please run this script from the root of the Requiem project."
exit 1
fi
echo "[1/3] Running Flutter Clean..."
if command -v flutter &> /dev/null; then
flutter clean
else
echo "Flutter CLI not found in PATH. Skipping 'flutter clean'..."
fi
echo
echo "[2/3] Cleaning temporary files and folders..."
# Array of directories to remove
dirs_to_remove=(
".dart_tool"
"build"
".pub-cache"
".pub"
".idea"
"dism_mount"
"winpe_base"
"temp_assets"
"tmp"
"windows/flutter/ephemeral"
"linux/flutter/ephemeral"
)
for dir in "${dirs_to_remove[@]}"; do
if [ -d "$dir" ]; then
echo " Removing directory: $dir..."
rm -rf "$dir"
fi
done
# Files to remove
files_to_remove=(
".flutter-plugins"
".flutter-plugins-dependencies"
"diagnose.obj"
)
for file in "${files_to_remove[@]}"; do
if [ -f "$file" ]; then
echo " Removing file: $file..."
rm -f "$file"
fi
done
# Wildcard cleanup
echo " Removing root .iso files..."
rm -f *.iso
echo " Removing .iml, .ipr, .iws files..."
rm -f *.iml *.ipr *.iws
echo " Removing compiled executables in inno/..."
if [ -d "inno" ]; then
rm -f inno/*.exe
fi
echo " Removing python pycache and compiled files..."
find . -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null
find . -type f -name "*.pyc" -delete 2>/dev/null
echo " Removing logs..."
rm -f *.log
if [ -d "scratch" ]; then
rm -f scratch/*.log
fi
echo
echo "[3/3] Done! Project cleaned successfully."
echo "You can now safely zip or migrate the project directory."
echo