diff options
-rwxr-xr-x | lorry | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -241,10 +241,15 @@ class Lorry(cliapp.Application): def process_args(self, args): status = 0 - - self.settings['working-area'] = os.path.abspath(self.settings['working-area']) - if not os.path.exists(self.settings['working-area']): - os.makedirs(self.settings['working-area']) + + def ensure_path_exists(setting_name): + full_path = os.path.abspath(self.settings[setting_name]) + if not os.path.exists(full_path): + os.makedirs(full_path) + self.settings[setting_name] = full_path + + ensure_path_exists('working-area') + ensure_path_exists('tarball-dest') urllib.request.install_opener( urllib.request.build_opener(SimpleFTPHandler)) |