Portable copy_dir_contents_to_dir (#1246)
Co-authored-by: James Sharpe <james.sharpe@zenotech.com>
This commit is contained in:
parent
af66969246
commit
509b5aa6d6
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue