diff options
author | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2011-12-01 13:13:02 +0000 |
---|---|---|
committer | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2011-12-01 13:13:02 +0000 |
commit | 159c90e1e485f9fe9c3ad8093ed70e5b99ca63ac (patch) | |
tree | 2a35589c79ac15eaf54d37619a78cbfccdd27ba9 /morph | |
parent | 71aa6dc4b72374aa84b4c1bb4067a2b7841e4322 (diff) | |
download | morph-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-x | morph | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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:] |