summaryrefslogtreecommitdiff
path: root/morph
diff options
context:
space:
mode:
authorLars Wirzenius <lars.wirzenius@codethink.co.uk>2011-12-01 13:13:02 +0000
committerLars Wirzenius <lars.wirzenius@codethink.co.uk>2011-12-01 13:13:02 +0000
commit159c90e1e485f9fe9c3ad8093ed70e5b99ca63ac (patch)
tree2a35589c79ac15eaf54d37619a78cbfccdd27ba9 /morph
parent71aa6dc4b72374aa84b4c1bb4067a2b7841e4322 (diff)
downloadmorph-159c90e1e485f9fe9c3ad8093ed70e5b99ca63ac.tar.gz
create cachedir at startup if it does not exist
We don't create it if running as root, since that would mean a typo creates a directory in a place that may be awkward. Anyone running builds as root can go create the directory themselves.
Diffstat (limited to 'morph')
-rwxr-xr-xmorph3
1 files changed, 3 insertions, 0 deletions
diff --git a/morph b/morph
index 9e61ac16..96987fa8 100755
--- a/morph
+++ b/morph
@@ -58,6 +58,9 @@ class Morph(cliapp.Application):
tempdir = morphlib.tempdir.Tempdir()
builder = morphlib.builder.Builder(tempdir, self.msg, self.settings)
+ if not os.path.exists(self.settings['cachedir']) and os.getuid() != 0:
+ os.mkdir(self.settings['cachedir'])
+
while len(args) >= 3:
repo, ref, filename = args[:3]
args = args[3:]