Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions rules/private/copy_directory_private.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,13 @@ def _copy_cmd(ctx, src, dst):
# https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/robocopy
# NB: robocopy return non-zero exit codes on success so we must exit 0 after calling it
cmd_tmpl = """\
if not exist \"{src}\\\" (
echo Error: \"{src}\" is not a directory
@exit 1
)
@robocopy \"{src}\" \"{dst}\" /E /MIR >NUL & @exit 0
"""
@ECHO OFF
if not exist \"{src}\\\" (
echo Error: \"{src}\" is not a directory
@exit 1
)
@robocopy \"{src}\" \"{dst}\" /E /MIR >NUL & @exit 0
"""
mnemonic = "CopyDirectory"
progress_message = "Copying directory %{input}"

Expand Down
5 changes: 4 additions & 1 deletion rules/private/copy_file_private.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ def copy_cmd(ctx, src, dst):
output = bat,
# Do not use lib/shell.bzl's shell.quote() method, because that uses
# Bash quoting syntax, which is different from cmd.exe's syntax.
content = "@copy /Y \"%s\" \"%s\" >NUL" % (
content = """\
@ECHO OFF
@copy /Y \"%s\" \"%s\" >NUL
""" % (
src.path.replace("/", "\\"),
dst.path.replace("/", "\\"),
),
Expand Down