Skip to content

Commit

Permalink
Portable copy_dir_contents_to_dir (#1246)
Browse files Browse the repository at this point in the history
Co-authored-by: James Sharpe <[email protected]>
  • Loading branch information
lamcw and jsharpe authored Aug 8, 2024
1 parent af66969 commit 509b5aa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions foreign_cc/private/framework/toolchains/freebsd_commands.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions foreign_cc/private/framework/toolchains/macos_commands.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 509b5aa

Please sign in to comment.