-
Notifications
You must be signed in to change notification settings - Fork 113
Closed
Description
Description of the issue
The push method from the Device class has an small bug when pushing folders recursively. This is the structure of the folder I want to push:
/home/israel/resource
├── dtd
│ └── test1.dtd
└── xml
├── test1.xml
├── test2.xml
├── testAttrEnvVar.xml
└── testEnvVar.xmlThis is how I'm calling the method:
device.push("/home/israel/resource", "/sdcard")The previous situations raises:
RuntimeError: ERROR: 'FAIL' +Cause:
The cause is located in this loop:
for root, dirs, files in os.walk(src):
root_dir_path = os.path.join(basename, root.replace(src, ""))First iteration:
src = /tmp/tmp0s3s470s/rtixmlTester/resource
basename = resource
root = /tmp/tmp0s3s470s/rtixmlTester/resource
root_dir_path = resource/
Second iteration:
src = /tmp/tmp0s3s470s/rtixmlTester/resource
basename = resource
root = /tmp/tmp0s3s470s/rtixmlTester/resource/xml
root_dir_path = /xml
The value for root_dir_path is wrong and should be resource/xml.
Workaround:
A "quick" fix is to just add / to the end of the src parameter:
device.push("/home/israel/resource/", "/sdcard")Metadata
Metadata
Assignees
Labels
No labels