endef 1.0.2 → 1.0.3

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/de.sh +7 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "endef",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Encrypt or Decrypt Files Test",
5
5
  "bin": {
6
6
  "endef": "bin/main.js"
package/src/de.sh CHANGED
@@ -5,12 +5,18 @@ DIR=$1
5
5
  remove_suffix() {
6
6
  local directory=$1
7
7
 
8
- # 使用 find 命令查找以 . 开头的文件
8
+ # 使用 find 命令查找以 . 开头的文件和空文件
9
9
  while IFS= read -r -d '' file; do
10
10
  # 获取文件名和目录路径
11
11
  filename=$(basename "$file")
12
12
  dir=$(dirname "$file")
13
13
 
14
+ # 判断是否需要跳过该文件
15
+ if ! [[ $filename =~ \._\$_foobar ]]; then
16
+ echo "Skipping file: $file"
17
+ continue
18
+ fi
19
+
14
20
  # 移除后缀
15
21
  new_filename=${filename%%._$_foobar*}
16
22