mirror of
https://github.com/ARM-software/devlib.git
synced 2025-01-31 10:10:46 +00:00
Merge pull request #73 from bjackman/file-exists-root
target: Use root in file_exists check
This commit is contained in:
commit
b35a283592
@ -362,7 +362,8 @@ class Target(object):
|
|||||||
|
|
||||||
def file_exists(self, filepath):
|
def file_exists(self, filepath):
|
||||||
command = 'if [ -e \'{}\' ]; then echo 1; else echo 0; fi'
|
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):
|
def directory_exists(self, filepath):
|
||||||
output = self.execute('if [ -d \'{}\' ]; then echo 1; else echo 0; fi'.format(filepath))
|
output = self.execute('if [ -d \'{}\' ]; then echo 1; else echo 0; fi'.format(filepath))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user