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
|
# Use find to check if any files match the pattern
|
||||||
if find "$root_dir" -path "$search_path" 2>/dev/null | grep -q .; then
|
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."
|
echo "Warning: Protected pattern '$pattern' matches files in '$root_dir'. Skipping..."
|
||||||
exit 1
|
continue
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
# Exact match for non-wildcard entries
|
# Exact match for non-wildcard entries
|
||||||
if [ -e "$root_dir/$pattern" ]; then
|
if [ -e "$root_dir/$pattern" ]; then
|
||||||
echo "Error: Protected item '$pattern' found in '$root_dir'. Aborting execution."
|
echo "Warning: Protected item '$pattern' found in '$root_dir'. Skipping..."
|
||||||
exit 1
|
continue
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
done < "$PROTECTED_LIST"
|
done < "$PROTECTED_LIST"
|
||||||
|
Loading…
Reference in New Issue
Block a user