chore: config变更,及匹配模式优化

This commit is contained in:
2025-11-18 10:04:11 +08:00
parent f76320f732
commit 4f299a8bf1
4 changed files with 48 additions and 26 deletions

View File

@@ -335,10 +335,10 @@ scan_directory() {
# 获取文件信息
local file_info
if file_info=$(get_file_info "$file_path" 2>/dev/null); then
# 检查是否应该包含
if should_include_file "$file_path" "$file_info"; then
# 检查是否应该包含该文件
local relative_path="${file_path#$base_dir/}" # 这里一定要使用相对路径方便在config中配置匹配模式
if should_include_file "$relative_path" "$file_info"; then
local file_hash=$(get_file_hash "$file_path" "$HASH_ALGORITHM")
local relative_path="${file_path#$base_dir/}"
echo "$relative_path|$file_info|$file_hash" >> "$output_file"
((file_count++))