Create link to data directory in web dir
authorFrederic Massart <fred@moodle.com>
Thu, 30 Aug 2012 08:01:22 +0000 (16:01 +0800)
committerFrederic Massart <fred@moodle.com>
Thu, 30 Aug 2012 08:01:22 +0000 (16:01 +0800)
config-dist.json
lib/workplace.py

index a4605bb..4044c89 100644 (file)
     // Can be useful to prevent fetch from a slow remote.
     "useCacheAsRemote": false,
 
+    // Name of the symlink pointing to the data directory to create in the www directory
+    // during an instance creation. If false, the symlink won't be created.
+    "symlinkToData": "_data",
+
     // You should not edit this, this is the branch that is considered as master by developers.
     "masterBranch": 24
 }
\ No newline at end of file
index 6580ff8..7531cfd 100644 (file)
@@ -113,6 +113,12 @@ class Workplace(object):
         else:
             os.symlink(wwwDir, linkDir)
 
+        # Symlink to dataDir in wwwDir
+        if C('symlinkToData'):
+            linkDataDir = os.path.join(wwwDir, C('symlinkToData'))
+            if not os.path.isfile(linkDataDir) and not os.path.isdir(linkDataDir) and not os.path.islink(linkDataDir):
+                os.symlink(dataDir, linkDataDir)
+
         # Creating, fetch, pulling branches
         debug('Checking out branch...')
         M = self.get(name)