summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVijay Kumar Banerjee <vijaykumar9597@gmail.com>2020-01-24 15:27:15 +0530
committerChris Johns <chrisj@rtems.org>2020-01-28 08:36:35 +1100
commit2852cac71a442681cdc9c6e98a7d2c7b3cd4548c (patch)
treef60617edd2a2d2fbb7eafc4e4fd5abac16d1cdd0
parenttester: Prefer '_' as test state separator char (diff)
downloadrtems-tools-2852cac71a442681cdc9c6e98a7d2c7b3cd4548c.tar.bz2
rtemstoolkit/path: Add support to copy single file
-rw-r--r--rtemstoolkit/path.py8
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 = []