We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6aa261a commit cc39698Copy full SHA for cc39698
.github/workflows/sync-demo.yml
@@ -37,7 +37,6 @@ jobs:
37
- name: Clean demo directory
38
run: |
39
cd demo
40
- # 删除所有文件/文件夹,但保留 .git
41
find . -mindepth 1 -path './.git' -prune -o -exec rm -rf {} + 2>/dev/null || true
42
43
- name: Copy files using config
@@ -51,10 +50,12 @@ jobs:
51
50
if [ -e "$src" ]; then
52
target_path="demo/$dst"
53
+ # 处理目录(以/结尾或本身是目录)
54
if [[ "$dst" == */ ]] || [ -d "$src" ]; then
55
mkdir -p "$target_path"
56
- cp -r "$src" "$target_path"
57
- echo "Copied $src → $target_path"
+ # 复制目录里的内容,而不是目录本身
+ cp -r "$src"/* "$target_path"
58
+ echo "Copied $src/* → $target_path"
59
else
60
mkdir -p "$(dirname "$target_path")"
61
cp "$src" "$target_path"
0 commit comments