From d86d67f49c875e05b373dcf7972f15c3e3fe7d09 Mon Sep 17 00:00:00 2001 From: Volker Eckert Date: Fri, 7 Sep 2018 18:35:40 +0100 Subject: [PATCH] target.py: cope with non-root users and with non-standard home directories --- devlib/target.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/devlib/target.py b/devlib/target.py index 147239f..da7260a 100644 --- a/devlib/target.py +++ b/devlib/target.py @@ -948,10 +948,7 @@ class LinuxTarget(Target): def _resolve_paths(self): if self.working_directory is None: - if self.connected_as_root: - self.working_directory = '/root/devlib-target' - else: - self.working_directory = '/home/{}/devlib-target'.format(self.user) + self.working_directory = self.path.join(self.execute("pwd").strip(), 'devlib-target') self._file_transfer_cache = self.path.join(self.working_directory, '.file-cache') if self.executables_directory is None: self.executables_directory = self.path.join(self.working_directory, 'bin')