Prechádzať zdrojové kódy

Split apps into their subdomains when extracting

Including app plugins and app groups.

This matches how other backup tools work, and the information in
e.g: https://doi.org/10.15394/jdfsl.2011.1099

We only split on the first dash to preserve app identifiers
with dashes, which is common in app groups e.g.
Tor Arne Vestbø 5 rokov pred
rodič
commit
f947e20342
1 zmenil súbory, kde vykonal 7 pridanie a 1 odobranie
  1. 7 1
      tools/reports/backup/files.js

+ 7 - 1
tools/reports/backup/files.js

@@ -117,7 +117,13 @@ function extractFiles (backup, destination, filter, items) {
     }
 
     try {
-      var filePath = path.join(item.domain, item.filename)
+      var domainPath = item.domain
+      if (domainPath.match(/^AppDomain.*-/)) {
+        // Extract sub-domain from app domain
+        domainPath = domainPath.replace('-', path.sep)
+      }
+
+      var filePath = path.join(domainPath, item.filename)
       var stat = new Mode(item)
 
       if (stat.isSymbolicLink()) {