Portable copy_dir_contents_to_dir (#1246)

Co-authored-by: James Sharpe <james.sharpe@zenotech.com>
This commit is contained in:
Thomas Lam 2024-08-08 19:22:40 +08:00 committed by GitHub
parent af66969246
commit 509b5aa6d6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View File

@ -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

View File

@ -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