summaryrefslogtreecommitdiff
path: root/lorry
diff options
context:
space:
mode:
authorKyle Mckay <kyle.mckay@codethink.co.uk>2021-12-15 17:54:09 +0000
committerKyle Mckay <kyle.mckay@codethink.co.uk>2021-12-15 17:58:07 +0000
commit913b47f3e9859acf7b3b959423cb30c2081b887b (patch)
treed2590e7d7a4dca4473b1477edf7dfd3cefa0b057 /lorry
parentc254ed305772b3173e97d7dea6e2da03bf9ec75d (diff)
downloadlorry-913b47f3e9859acf7b3b959423cb30c2081b887b.tar.gz
Create tarball destination when non-existent
Just a quality of life improvement Closes #23
Diffstat (limited to 'lorry')
-rwxr-xr-xlorry13
1 files changed, 9 insertions, 4 deletions
diff --git a/lorry b/lorry
index c3c6208..2a55969 100755
--- a/lorry
+++ b/lorry
@@ -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))