diff --git a/app/index.js b/app/index.js index adf769c..69cccce 100644 --- a/app/index.js +++ b/app/index.js @@ -76,7 +76,7 @@ module.exports = generators.Base.extend({ this.prompt([{ type: 'list', name: 'starter', - message: 'Which starter template [T] or example app [A] would you like to use?', + message: 'Which starter template would you like to use?', choices: _.pluck(ionicUtils.starters.templates, 'name'), default: defaultIndex }], function (props) { @@ -160,7 +160,10 @@ module.exports = generators.Base.extend({ if (error) { done(error); } - remote.directory('app', 'app'); + + // Template remote initialization: Copy from remote root folder (.) to working directory (/app) + remote.directory('.', 'app'); + this.starterCache = remote.cachePath; done(); }.bind(this); @@ -182,9 +185,10 @@ module.exports = generators.Base.extend({ appJs: function appJs() { var appPath = path.join(process.cwd(), 'app'); - var scriptPrefix = 'scripts' + path.sep; + var scriptPrefix = 'js' + path.sep; var scripts = [scriptPrefix + 'config.js']; + this.fs.store.each(function (file, index) { if (file.path.indexOf('.js') !== -1) { @@ -195,12 +199,25 @@ module.exports = generators.Base.extend({ } }); - this.indexFile = this.appendScripts(this.indexFile, 'scripts/scripts.js', scripts); + //this.indexFile = this.appendScripts(this.indexFile, 'scripts/scripts.js', scripts); }, createIndexHtml: function createIndexHtml() { - this.indexFile = this.indexFile.replace(/'/g, "'"); - this.write(path.join(this.appPath, 'index.html'), this.indexFile); + + // Regex: CSS + this.indexFile = this.indexFile.replace(/lib\/ionic\/css/g,"bower_components\/ionic/release\/css"); + + // Regex: Third party scripts (vendor.js) + this.indexFile = this.indexFile.replace(/