1
0
mirror of https://github.com/ARM-software/devlib.git synced 2024-10-06 02:40:50 +01:00

Merge pull request #73 from bjackman/file-exists-root

target: Use root in file_exists check
This commit is contained in:
setrofim 2016-11-28 12:22:37 +00:00 committed by GitHub
commit b35a283592

View File

@ -362,7 +362,8 @@ class Target(object):
def file_exists(self, filepath):
command = 'if [ -e \'{}\' ]; then echo 1; else echo 0; fi'
return boolean(self.execute(command.format(filepath)).strip())
output = self.execute(command.format(filepath), as_root=self.is_rooted)
return boolean(output.strip())
def directory_exists(self, filepath):
output = self.execute('if [ -d \'{}\' ]; then echo 1; else echo 0; fi'.format(filepath))