From 509b5aa6d655b7ca9a19db57aa82e0aee53ee4ed Mon Sep 17 00:00:00 2001 From: Thomas Lam Date: Thu, 8 Aug 2024 19:22:40 +0800 Subject: [PATCH] Portable copy_dir_contents_to_dir (#1246) Co-authored-by: James Sharpe --- foreign_cc/private/framework/toolchains/freebsd_commands.bzl | 4 ++-- foreign_cc/private/framework/toolchains/macos_commands.bzl | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/foreign_cc/private/framework/toolchains/freebsd_commands.bzl b/foreign_cc/private/framework/toolchains/freebsd_commands.bzl index ccc6e58b..9fb552f5 100644 --- a/foreign_cc/private/framework/toolchains/freebsd_commands.bzl +++ b/foreign_cc/private/framework/toolchains/freebsd_commands.bzl @@ -95,11 +95,11 @@ fi ) def copy_dir_contents_to_dir(source, target): - # Beause FreeBSD `cp` doesn't have `--no-copy-directory`, we have to + # Beause FreeBSD `cp` doesn't have `--no-target-directory`, we have to # do something more complex for this environment. return """\ if [[ -d "{source}" ]]; then - cp -L -R "{source}"/* "{target}" + cp -L -R "{source}"/. "{target}" else cp -L -R "{source}" "{target}" fi diff --git a/foreign_cc/private/framework/toolchains/macos_commands.bzl b/foreign_cc/private/framework/toolchains/macos_commands.bzl index c088a967..ed04f241 100644 --- a/foreign_cc/private/framework/toolchains/macos_commands.bzl +++ b/foreign_cc/private/framework/toolchains/macos_commands.bzl @@ -86,11 +86,11 @@ fi ) def copy_dir_contents_to_dir(source, target): - # Beause macos `cp` doesn't have `--no-copy-directory`, we have to + # Beause macos `cp` doesn't have `--no-target-directory`, we have to # do something more complext for this environment. return """\ if [[ -d "{source}" ]]; then - cp -L -R "{source}"/ "{target}" + cp -L -R "{source}"/. "{target}" else cp -L -R "{source}" "{target}" fi