diff options
author | Vijay Kumar Banerjee <vijaykumar9597@gmail.com> | 2020-01-24 15:27:15 +0530 |
---|---|---|
committer | Chris Johns <chrisj@rtems.org> | 2020-01-28 08:36:35 +1100 |
commit | 2852cac71a442681cdc9c6e98a7d2c7b3cd4548c (patch) | |
tree | f60617edd2a2d2fbb7eafc4e4fd5abac16d1cdd0 | |
parent | tester: Prefer '_' as test state separator char (diff) | |
download | rtems-tools-2852cac71a442681cdc9c6e98a7d2c7b3cd4548c.tar.bz2 |
rtemstoolkit/path: Add support to copy single file
-rw-r--r-- | rtemstoolkit/path.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/rtemstoolkit/path.py b/rtemstoolkit/path.py index 9401e99..b15164b 100644 --- a/rtemstoolkit/path.py +++ b/rtemstoolkit/path.py @@ -314,8 +314,12 @@ def copy_tree(src, dst): hsrc = host(src) hdst = host(dst) - if exists(src): - names = listdir(src) + if exists(hsrc): + if isdir(hsrc): + names = listdir(hsrc) + else: + names = [basename(hsrc)] + hsrc = dirname(hsrc) else: names = [] |