fix: fix a bug where copy_to_directory wouldn't copy hidden files inside

of folders
This commit is contained in:
Derek Cormier 2022-05-19 20:30:25 -07:00 committed by Derek Cormier
parent 147a373568
commit faba95385d
4 changed files with 21 additions and 1 deletions

View File

@ -146,7 +146,7 @@ if [[ -f "{src}" ]]; then
cp -f "{src}" "{dst}"
else
mkdir -p "{dst}"
cp -fR "{src}"/* "{dst}"
cp -fR "{src}/." "{dst}"
fi
""".format(src = src_path, dst_dir = skylib_paths.dirname(dst_path), dst = dst_path))

View File

@ -22,6 +22,7 @@ load("//lib:directory_path.bzl", "make_directory_paths")
"expected_7",
"expected_8",
"expected_9",
"expected_10",
]
]
@ -232,3 +233,20 @@ diff_test(
file1 = "case_8",
file2 = ":expected_8",
)
# Case 10: copy folder containing hidden file
copy_to_directory(
name = "case_10",
srcs = [
":dir_g",
],
replace_prefixes = {
"dir_g": "",
},
)
diff_test(
name = "case_10_test",
file1 = "case_10",
file2 = ":expected_10",
)

View File

@ -0,0 +1 @@
foobar

View File

@ -0,0 +1 @@
foobar