From 159c90e1e485f9fe9c3ad8093ed70e5b99ca63ac Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Thu, 1 Dec 2011 13:13:02 +0000 Subject: 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. --- morph | 3 +++ 1 file changed, 3 insertions(+) (limited to 'morph') 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:] -- cgit v1.2.1