From ed0de00d6d5e26c180d28f1cc7aafd3361d799b2 Mon Sep 17 00:00:00 2001 From: Chris Johns Date: Tue, 30 Oct 2012 02:41:34 +1100 Subject: [PATCH] Create the sources path if not present and the user has forced. --- tb/build.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tb/build.py b/tb/build.py index 46a847d..7328cc2 100644 --- a/tb/build.py +++ b/tb/build.py @@ -119,7 +119,10 @@ class build: def get_file(self, url, local): if not os.path.isdir(os.path.dirname(local)): - raise error.general('source path not found: ' + os.path.dirname(local)) + if not self.opts.force(): + raise error.general('source path not found: %s; (--force to create)' \ + % (os.path.dirname(local))) + self.mkdir(os.path.dirname(local)) if not os.path.exists(local): # # Not localy found so we need to download it. Check if a URL