From 5bfb9cbc8c978fee284d127475831daa03c38c79 Mon Sep 17 00:00:00 2001 From: zj <1052308357@qq.com> Date: Sun, 30 Nov 2025 02:37:27 +0800 Subject: [PATCH] update dir --- add_empty_folders.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 add_empty_folders.sh diff --git a/add_empty_folders.sh b/add_empty_folders.sh new file mode 100755 index 0000000..5059ba2 --- /dev/null +++ b/add_empty_folders.sh @@ -0,0 +1,14 @@ +#!/bin/bash +# 保存为 add_empty_folders.sh + +echo "正在查找并处理空文件夹..." + +# 查找所有空文件夹并创建 .gitkeep +find . -type d -empty | while read dir; do + if [ ! -f "$dir/.gitkeep" ]; then + touch "$dir/.gitkeep" + echo "✅ 已创建: $dir/.gitkeep" + fi +done + +echo "处理完成!"