Skip to content

Commit cc39698

Browse files
fix: fix copy issue
1 parent 6aa261a commit cc39698

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

.github/workflows/sync-demo.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ jobs:
3737
- name: Clean demo directory
3838
run: |
3939
cd demo
40-
# 删除所有文件/文件夹,但保留 .git
4140
find . -mindepth 1 -path './.git' -prune -o -exec rm -rf {} + 2>/dev/null || true
4241
4342
- name: Copy files using config
@@ -51,10 +50,12 @@ jobs:
5150
if [ -e "$src" ]; then
5251
target_path="demo/$dst"
5352
53+
# 处理目录(以/结尾或本身是目录)
5454
if [[ "$dst" == */ ]] || [ -d "$src" ]; then
5555
mkdir -p "$target_path"
56-
cp -r "$src" "$target_path"
57-
echo "Copied $src → $target_path"
56+
# 复制目录里的内容,而不是目录本身
57+
cp -r "$src"/* "$target_path"
58+
echo "Copied $src/* → $target_path"
5859
else
5960
mkdir -p "$(dirname "$target_path")"
6061
cp "$src" "$target_path"

0 commit comments

Comments
 (0)