-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathclean
More file actions
executable file
·54 lines (45 loc) · 1.3 KB
/
Copy pathclean
File metadata and controls
executable file
·54 lines (45 loc) · 1.3 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
#!/usr/bin/env bash
clean_path() {
local path=$1
if [ -d "$path" ]; then
# use git clean for directory
# that way we only delete ignored files we dont care about (e.g. cache)
echo "Cleaning $1..."
git clean -qfdX "$path"
elif [ -f "$path" ]; then
# us rm for files
echo "Removing $1..."
rm -f "$path"
fi
}
# Framework & Storage
clean_path "./bootstrap/cache"
clean_path "./storage/framework"
clean_path "./storage/logs"
# debugbar needs special treatment, potentially way too many files lol
find ./storage/debugbar -type f ! -name ".gitignore" -delete
if [[ "$1" == "--force" ]]; then
# Filament
clean_path "./public/css/filament"
clean_path "./public/fonts/filament"
clean_path "./public/js/filament"
# Vendor
rm -rf ./vendor
rm -rf ./node_modules
clean_path "./frankenphp"
clean_path "./public/frankenphp-worker.php"
clean_path "./.phpstorm.meta.php"
clean_path "./_ide_helper.php"
clean_path "./public/hot"
fi
# Wayfinder
if [ ! -f "./public/hot" ]; then
clean_path "./resources/js/actions"
clean_path "./resources/js/routes"
clean_path "./resources/js/wayfinder"
else
echo "Vite is running, skipping Wayfinder cleanup."
fi
# Build & Misc Files
clean_path "./public/build"
echo "done"