mirror of
https://github.com/ARM-software/devlib.git
synced 2025-06-19 21:45:12 +01:00
LinuxTarget: Ensure path is correctly quoted when listing directories
Previously the path for listing a directory on the device was not quoted causing it to fail on paths containing spaces. Now ensure the string is quoted and any quotes contained in the string as escaped.
This commit is contained in:
@ -883,7 +883,7 @@ class LinuxTarget(Target):
|
||||
return filtered_result
|
||||
|
||||
def list_directory(self, path, as_root=False):
|
||||
contents = self.execute('ls -1 {}'.format(path), as_root=as_root)
|
||||
contents = self.execute('ls -1 "{}"'.format(escape_double_quotes(path)), as_root=as_root)
|
||||
return [x.strip() for x in contents.split('\n') if x.strip()]
|
||||
|
||||
def install(self, filepath, timeout=None, with_name=None): # pylint: disable=W0221
|
||||
|
Reference in New Issue
Block a user