mirror of
https://github.com/tw93/Mole.git
synced 2026-02-17 14:23:54 +00:00
fix(clean): ensure flutter .dart_tool caches are discovered
This commit is contained in:
@@ -184,7 +184,6 @@ clean_project_caches() {
|
|||||||
-not -path "*/Library/*" \
|
-not -path "*/Library/*" \
|
||||||
-not -path "*/.Trash/*" \
|
-not -path "*/.Trash/*" \
|
||||||
-not -path "*/node_modules/*" \
|
-not -path "*/node_modules/*" \
|
||||||
-not -path "*/.*" \
|
|
||||||
-not -path "*/.fvm/*" \
|
-not -path "*/.fvm/*" \
|
||||||
2> /dev/null || true
|
2> /dev/null || true
|
||||||
) > "$flutter_tmp_file" 2>&1 &
|
) > "$flutter_tmp_file" 2>&1 &
|
||||||
|
|||||||
@@ -112,3 +112,25 @@ EOF
|
|||||||
[[ "$output" == *"npm"* ]]
|
[[ "$output" == *"npm"* ]]
|
||||||
[[ "$output" == *"brew"* ]]
|
[[ "$output" == *"brew"* ]]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@test "clean_project_caches cleans flutter .dart_tool and build directories" {
|
||||||
|
mkdir -p "$HOME/Code/flutter_app/.dart_tool" "$HOME/Code/flutter_app/build"
|
||||||
|
touch "$HOME/Code/flutter_app/.dart_tool/cache.bin"
|
||||||
|
touch "$HOME/Code/flutter_app/build/output.bin"
|
||||||
|
|
||||||
|
run env HOME="$HOME" PROJECT_ROOT="$PROJECT_ROOT" bash --noprofile --norc <<'EOF'
|
||||||
|
set -euo pipefail
|
||||||
|
source "$PROJECT_ROOT/lib/core/common.sh"
|
||||||
|
source "$PROJECT_ROOT/lib/clean/caches.sh"
|
||||||
|
start_inline_spinner() { :; }
|
||||||
|
stop_inline_spinner() { :; }
|
||||||
|
create_temp_file() { mktemp; }
|
||||||
|
safe_clean() { echo "$2|$1"; }
|
||||||
|
DRY_RUN=false
|
||||||
|
clean_project_caches
|
||||||
|
EOF
|
||||||
|
|
||||||
|
[ "$status" -eq 0 ]
|
||||||
|
[[ "$output" == *"Flutter build cache (.dart_tool)"* ]]
|
||||||
|
[[ "$output" == *"Flutter build cache (build/)"* ]]
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user