Skip to content

Commit ac4ca21

Browse files
committed
Merge pull request google#9 from tgalal/recursive_push
Support push directories
2 parents f944faf + d1d2f99 commit ac4ca21

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

adb/adb_commands.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,13 @@ def Push(self, source_file, device_filename, mtime='0', timeout_ms=None):
151151
mtime: Optional, modification time to set on the file.
152152
timeout_ms: Expected timeout for any part of the push.
153153
"""
154+
155+
if os.path.isdir(source_file):
156+
self.Shell("mkdir " + device_filename)
157+
for dir_file in os.listdir(source_file):
158+
self.Push(os.path.join(source_file, dir_file), device_filename + "/" + dir_file)
159+
return
160+
154161
connection = self.protocol_handler.Open(
155162
self.handle, destination='sync:',
156163
timeout_ms=timeout_ms)

0 commit comments

Comments
 (0)