From 54d6a6d39dfb6340287764102ee56c6eda001d9b Mon Sep 17 00:00:00 2001 From: Marc Bonnici Date: Mon, 8 Jan 2018 14:01:05 +0000 Subject: [PATCH] target: Allow pulling of folders as root Adds '-r' flag to copy command to allow for copying of folders with their contents to temporary location on the device before pulling. --- devlib/target.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devlib/target.py b/devlib/target.py index 87bb456..c3e7985 100644 --- a/devlib/target.py +++ b/devlib/target.py @@ -292,7 +292,7 @@ class Target(object): else: device_tempfile = self.path.join(self._file_transfer_cache, source.lstrip(self.path.sep)) self.execute("mkdir -p '{}'".format(self.path.dirname(device_tempfile))) - self.execute("cp '{}' '{}'".format(source, device_tempfile), as_root=True) + self.execute("cp -r '{}' '{}'".format(source, device_tempfile), as_root=True) self.execute("chmod 0644 '{}'".format(device_tempfile), as_root=True) self.conn.pull(device_tempfile, dest, timeout=timeout)