diff --git a/app-template/apply.js b/app-template/apply.js index 9b643800e..1aaee94de 100755 --- a/app-template/apply.js +++ b/app-template/apply.js @@ -23,8 +23,6 @@ var MakefileHeader = "# PLEASE! Do not edit this file directly \n# Modify var fs = require('fs-extra'); var path = require('path'); - - var configBlob = fs.readFileSync(configDir + '/appConfig.json', 'utf8'); var config = JSON.parse(configBlob, 'utf8'); @@ -101,43 +99,17 @@ try { } fs.writeFileSync('../externalServices.json', externalServices, 'utf8'); -function copyDir(from, to, cb) { +function copyDir(from, to) { console.log('Copying dir ' + from + ' to ' + to); if (fs.existsSync(to)) fs.removeSync(to); // remove previous app directory if (!fs.existsSync(from)) return; // nothing to do - var files = []; - fs.walk(from) - .on('data', function(item) { - if ((item.stats["mode"] & 0x4000)) { - - var tmp = item.path + '/'; - var l = tmp.length - from.length; - if (tmp.indexOf(from) == l) return; // #same dir - - } - if (item.path.indexOf('DS_Store') >= 0) return; - - if (!files.includes(path.dirname(item.path))) { - files.push(item.path); - } - }) - .on('end', function() { - files.forEach(function(i) { - console.log(' # ' + i); - fs.copySync(i, to); - }) - return cb(); - - }) - + fs.copySync(from, to); } // Push Notification fs.copySync(configDir + '/GoogleService-Info.plist', '../GoogleService-Info.plist'); fs.copySync(configDir + '/google-services.json', '../google-services.json'); -copyDir(configDir + '/img', '../www/img/app', function() { - copyDir(configDir + '/saas', '../src/sass/app', function() { - console.log("apply.js finished. \n\n"); - }); -}); +copyDir(configDir + '/img', '../www/img/app'); +copyDir(configDir + '/sass', '../src/sass/app'); +console.log("apply.js finished. \n\n");