diff options
author | Ben Brown <ben@demerara.io> | 2021-12-15 18:02:40 +0000 |
---|---|---|
committer | Ben Brown <ben@demerara.io> | 2021-12-15 18:02:40 +0000 |
commit | 07ef3b67c0f13c86d475b3d6743600a0199b7195 (patch) | |
tree | d2590e7d7a4dca4473b1477edf7dfd3cefa0b057 | |
parent | c254ed305772b3173e97d7dea6e2da03bf9ec75d (diff) | |
parent | 913b47f3e9859acf7b3b959423cb30c2081b887b (diff) | |
download | lorry-07ef3b67c0f13c86d475b3d6743600a0199b7195.tar.gz |
Merge branch 'dest' into 'master'
Create tarball destination when non-existent
Closes #23
See merge request CodethinkLabs/lorry/lorry!28
-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)) |