update
This commit is contained in:
parent
97bd3a1c88
commit
d3939e3b94
@ -33,14 +33,14 @@ check_protected_items() {
|
||||
|
||||
# Use find to check if any files match the pattern
|
||||
if find "$root_dir" -path "$search_path" 2>/dev/null | grep -q .; then
|
||||
echo "Error: Protected pattern '$pattern' matches files in '$root_dir'. Aborting execution."
|
||||
exit 1
|
||||
echo "Warning: Protected pattern '$pattern' matches files in '$root_dir'. Skipping..."
|
||||
continue
|
||||
fi
|
||||
else
|
||||
# Exact match for non-wildcard entries
|
||||
if [ -e "$root_dir/$pattern" ]; then
|
||||
echo "Error: Protected item '$pattern' found in '$root_dir'. Aborting execution."
|
||||
exit 1
|
||||
echo "Warning: Protected item '$pattern' found in '$root_dir'. Skipping..."
|
||||
continue
|
||||
fi
|
||||
fi
|
||||
done < "$PROTECTED_LIST"
|
||||
|
Loading…
Reference in New Issue
Block a user