mirror of
https://github.com/tw93/Mole.git
synced 2026-02-04 13:16:47 +00:00
fix: Respect whitelisted subdirectories
This commit is contained in:
@@ -114,3 +114,18 @@ setup() {
|
||||
run grep -q "\\.m2/repository" "$whitelist_file"
|
||||
[ "$status" -eq 1 ]
|
||||
}
|
||||
|
||||
@test "is_path_whitelisted protects parent directories of whitelisted nested paths" {
|
||||
local status
|
||||
if HOME="$HOME" bash --noprofile --norc -c "
|
||||
source '$PROJECT_ROOT/lib/core/base.sh'
|
||||
source '$PROJECT_ROOT/lib/core/app_protection.sh'
|
||||
WHITELIST_PATTERNS=(\"\$HOME/Library/Caches/org.R-project.R/R/renv\")
|
||||
is_path_whitelisted \"\$HOME/Library/Caches/org.R-project.R\"
|
||||
"; then
|
||||
status=0
|
||||
else
|
||||
status=$?
|
||||
fi
|
||||
[ "$status" -eq 0 ]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user