mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
chore(tooling): add inquirer as generator dependency
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
"@reactivex/rxjs": "5.0.0-alpha.4",
|
||||
"angular2": "2.0.0-alpha.44",
|
||||
"es6-shim": "^0.33.6",
|
||||
"inquirer": "^0.11.0",
|
||||
"lodash": "^3.10.1",
|
||||
"reflect-metadata": "0.1.1",
|
||||
"shelljs": "^0.5.3",
|
||||
|
||||
@@ -30,10 +30,6 @@ Generate.generate = function generate(options) {
|
||||
Generate.log = options.log;
|
||||
}
|
||||
|
||||
if (options.inquirer) {
|
||||
Generate.inquirer = options.inquirer;
|
||||
}
|
||||
|
||||
if (options.q) {
|
||||
Generate.q = options.q;
|
||||
}
|
||||
@@ -44,7 +40,6 @@ Generate.generate = function generate(options) {
|
||||
|
||||
var generateOptions = {
|
||||
appDirectory: options.appDirectory,
|
||||
inquirer: options.inquirer,
|
||||
fileAndClassName: Generate.fileAndClassName(options.name),
|
||||
javascriptClassName: Generate.javascriptClassName(options.name),
|
||||
name: options.name
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
var fs = require('fs'),
|
||||
path = require('path'),
|
||||
inquirer = require('inquirer'),
|
||||
Generator = module.exports,
|
||||
Generate = require('../../generate'),
|
||||
path = require('path');
|
||||
Generate = require('../../generate');
|
||||
|
||||
Generator.validate = function(input) {
|
||||
// console.log(typeof parseInt(input));
|
||||
@@ -17,7 +18,7 @@ Generator.numberNames = ['first', 'second', 'third', 'fourth', 'fifth'];
|
||||
Generator.promptForTabCount = function promptForTabCount() {
|
||||
var q = Generate.q.defer();
|
||||
|
||||
Generate.inquirer.prompt({choices: ['1', '2', '3', '4', '5'], message: 'How many tabs will you have?', name: 'count', type: 'list', validate: Generator.validate}, function(result) {
|
||||
inquirer.prompt({choices: ['1', '2', '3', '4', '5'], message: 'How many tabs will you have?', name: 'count', type: 'list', validate: Generator.validate}, function(result) {
|
||||
q.resolve(result.count);
|
||||
});
|
||||
|
||||
@@ -27,7 +28,7 @@ Generator.promptForTabCount = function promptForTabCount() {
|
||||
Generator.promptForTabName = function promptForTabName(tabIndex, options) {
|
||||
var q = Generate.q.defer();
|
||||
|
||||
Generate.inquirer.prompt({message: 'Enter the ' + Generator.numberNames[tabIndex] + ' tab name:', name: 'name', type: 'input'}, function(nameResult) {
|
||||
inquirer.prompt({message: 'Enter the ' + Generator.numberNames[tabIndex] + ' tab name:', name: 'name', type: 'input'}, function(nameResult) {
|
||||
Generator.tabs.push({ appDirectory: options.appDirectory, fileAndClassName: Generate.fileAndClassName(nameResult.name), javascriptClassName: Generate.javascriptClassName(nameResult.name), name: nameResult.name });
|
||||
q.resolve();
|
||||
});
|
||||
@@ -63,9 +64,9 @@ Generator.run = function run(options) {
|
||||
// console.log('Using tabs:', Generator.tabs);
|
||||
// });
|
||||
})
|
||||
.then(function() {
|
||||
.then(function() {
|
||||
var templates = Generate.loadGeneratorTemplates(__dirname);
|
||||
|
||||
|
||||
//Generate the tabs container page templates
|
||||
templates.forEach(function(template) {
|
||||
var templatePath = path.join(__dirname, template.file);
|
||||
|
||||
Reference in New Issue
Block a user