endef 1.0.4 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/de.sh +11 -2
- package/src/en.js +12 -12
package/package.json
CHANGED
package/src/de.sh
CHANGED
|
@@ -11,8 +11,17 @@ process_filename() {
|
|
|
11
11
|
local new_filename=${filename%%._$_foobar*} # 移除指定字符串
|
|
12
12
|
local new_path="$dir/$new_filename" # 构建新的文件路径
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
# 判断新文件名对应的文件是否存在
|
|
15
|
+
if [[ -f "$new_path" ]]; then
|
|
16
|
+
if grep -q "E-SafeNet" "$new_path"; then
|
|
17
|
+
rm "$new_path" # 删除包含特定内容的文件
|
|
18
|
+
mv "$file" "$new_path" # 重命名文件
|
|
19
|
+
echo "Renamed: $filename -> $new_filename"
|
|
20
|
+
else
|
|
21
|
+
rm "$file" # 删除不包含特定内容的文件
|
|
22
|
+
echo "Deleted: $filename"
|
|
23
|
+
fi
|
|
24
|
+
fi
|
|
16
25
|
fi
|
|
17
26
|
}
|
|
18
27
|
|
package/src/en.js
CHANGED
|
@@ -39,18 +39,18 @@ export default function processFiles(directory) {
|
|
|
39
39
|
console.log('Temp file written:', tempFilePath)
|
|
40
40
|
|
|
41
41
|
// 删除原文件
|
|
42
|
-
fs.unlink(filePath, err => {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
})
|
|
42
|
+
// fs.unlink(filePath, err => {
|
|
43
|
+
// if (err) {
|
|
44
|
+
// console.error('Error deleting temp file:', err)
|
|
45
|
+
// } else {
|
|
46
|
+
// // console.log('Temp file deleted:', filePath);
|
|
47
|
+
// /*fs.rename(tempFilePath, filePath, (err) => {
|
|
48
|
+
// if(!err) {
|
|
49
|
+
// console.log(newName + ' 已重命名!')
|
|
50
|
+
// }
|
|
51
|
+
// })*/
|
|
52
|
+
// }
|
|
53
|
+
// })
|
|
54
54
|
})
|
|
55
55
|
})
|
|
56
56
|
}
|