mirror of
https://github.com/bazel-contrib/bazel-lib
synced 2024-11-27 17:43:27 +00:00
fix: allow copy_to_directory to have an empty srcs list (#871)
This commit is contained in:
parent
3330c38904
commit
18ae5a89a6
|
@ -461,9 +461,6 @@ def copy_to_directory_bin_action(
|
||||||
})
|
})
|
||||||
file_inputs.append(f.file)
|
file_inputs.append(f.file)
|
||||||
|
|
||||||
if not file_inputs:
|
|
||||||
fail("No files to copy")
|
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
"allow_overwrites": allow_overwrites,
|
"allow_overwrites": allow_overwrites,
|
||||||
"dst": dst.path,
|
"dst": dst.path,
|
||||||
|
|
|
@ -449,3 +449,22 @@ diff_test(
|
||||||
file1 = "case_21",
|
file1 = "case_21",
|
||||||
file2 = ":expected_21",
|
file2 = ":expected_21",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Case 22: empty sources creates an empty directory output
|
||||||
|
copy_to_directory(
|
||||||
|
name = "case_22",
|
||||||
|
srcs = [],
|
||||||
|
)
|
||||||
|
|
||||||
|
copy_to_directory(
|
||||||
|
name = "expected_22",
|
||||||
|
srcs = ["dir_expected_22"],
|
||||||
|
exclude_srcs_patterns = ["**/filter_me_out"],
|
||||||
|
)
|
||||||
|
|
||||||
|
diff_test(
|
||||||
|
name = "case_22_test",
|
||||||
|
file1 = "case_22",
|
||||||
|
file2 = ":expected_22",
|
||||||
|
tags = ["local"], # seems that the Bazel sandbox has trouble with empty directories
|
||||||
|
)
|
||||||
|
|
Loading…
Reference in a new issue