diff options
author | Kyle Mckay <kyle.mckay@codethink.co.uk> | 2021-12-15 17:54:09 +0000 |
---|---|---|
committer | Kyle Mckay <kyle.mckay@codethink.co.uk> | 2021-12-15 17:58:07 +0000 |
commit | 913b47f3e9859acf7b3b959423cb30c2081b887b (patch) | |
tree | d2590e7d7a4dca4473b1477edf7dfd3cefa0b057 /lorry | |
parent | c254ed305772b3173e97d7dea6e2da03bf9ec75d (diff) | |
download | lorry-913b47f3e9859acf7b3b959423cb30c2081b887b.tar.gz |
Create tarball destination when non-existent
Just a quality of life improvement
Closes #23
Diffstat (limited to 'lorry')
-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)) |