fix: use -R instead of -r in cp calls so macos & linxu behavior is the same (#58)

This commit is contained in:
Greg Magolan 2022-04-01 00:57:34 -07:00 committed by GitHub
parent e30e89fa3d
commit e679a26b42
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -85,7 +85,7 @@ def copy_cmd(ctx, src_file, src_path, dst):
# buildifier: disable=function-docstring
def copy_bash(ctx, src_file, src_path, dst):
if dst.is_directory:
cmd_tmpl = "rm -rf \"$2\" && cp -rf \"$1/\" \"$2\""
cmd_tmpl = "rm -rf \"$2\" && cp -fR \"$1/\" \"$2\""
mnemonic = "CopyDirectory"
progress_message = "Copying directory %s" % src_path
else:

View File

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

View File

@ -167,7 +167,7 @@ if [[ -f "$in" ]]; then
chmod 664 "$out"
else
mkdir -p "$out"
cp -rf "$in"/* "$out"
cp -fR "$in"/* "$out"
chmod 664 "$out"/*
fi
""".format(in_path = in_path, out_path = out_path))