我今天一直试图制作一个雪泥发电机,没有运气。我在线跟踪了几个教程,并认为我做的一切都是正确的。但是,当我运行发电机时它没有做任何事情......我不确定我需要修理什么。如果您能发现我的问题,请告诉我。文件可以在https://github.com/ryanswapp/slush-swappticon
找到slushfile.js
/*
* slush-swappticon
* https://github.com/ryanswapp/slush-swappticon
*
* Copyright (c) 2014, Ryan Swapp
* Licensed under the MIT license.
*/
'use strict';
var gulp = require('gulp'),
install = require('gulp-install'),
conflict = require('gulp-conflict'),
template = require('gulp-template'),
rename = require('gulp-rename'),
_ = require('underscore.string'),
inquirer = require('inquirer');
function format(string) {
var username = string.toLowerCase();
return username.replace(/\s/g, '');
}
var defaults = (function () {
var homeDir = process.env.HOME || process.env.HOMEPATH || process.env.USERPROFILE,
workingDirName = process.cwd().split('/').pop().split('\\').pop(),
osUserName = homeDir && homeDir.split('/').pop() || 'root',
configFile = homeDir + '/.gitconfig',
user = {};
if (require('fs').existsSync(configFile)) {
user = require('iniparser').parseSync(configFile).user;
}
return {
appName: workingDirName,
userName: format(user.name) || osUserName,
authorEmail: user.email || ''
};
})();
gulp.task('default', function (done) {
var prompts = [{
name: 'appName',
message: 'What is the name of your project?',
default: defaults.appName
}, {
name: 'appDescription',
message: 'What is the description?'
}, {
name: 'appVersion',
message: 'What is the version of your project?',
default: '0.1.0'
}, {
name: 'authorName',
message: 'What is the author name?',
}];
//Ask
inquirer.prompt(prompts,
function (answers) {
if (!answers.moveon) {
return done();
}
answers.appNameSlug = _.slugify(answers.appName);
gulp.src(__dirname + '/templates/**')
.pipe(template(answers))
.pipe(rename(function (file) {
if (file.basename[0] === '_') {
file.basename = '.' + file.basename.slice(1);
}
}))
.pipe(conflict('./'))
.pipe(gulp.dest('./'))
.pipe(install())
.on('end', function () {
done();
});
});
});
的package.json
{
"name": "slush-swappticon",
"description": "A simple AngularJS with ui-router generator",
"version": "0.1.1",
"homepage": "https://github.com/ryanswapp/slush-swappticon",
"author": {
"name": "Ryan Swapp",
"email": "ryancswapp@gmail.com"
},
"repository": {
"type": "git",
"url": "git://github.com/ryanswapp/slush-swappticon.git"
},
"bugs": {
"url": "https://github.com/ryanswapp/slush-swappticon/issues"
},
"licenses": [{
"type": "MIT",
"url": "https://github.com/ryanswapp/slush-swappticon/blob/master/LICENSE"
}],
"main": "slushfile.js",
"engines": {
"node": ">= 0.10.26",
"npm": ">=1.4.3"
},
"scripts": {
"test": "echo \"No tests\""
},
"dependencies": {
"slush": ">=1.0.0",
"gulp": "^3.6.2",
"gulp-template": "^0.1.1",
"gulp-install": "^0.1.4",
"gulp-conflict": "^0.1.1",
"gulp-rename": "^1.2.0",
"underscore.string": "^2.3.3",
"inquirer": "^0.4.1",
"iniparser": "^1.0.5"
},
"keywords": [
"slushgenerator"
]
}
答案 0 :(得分:0)
您没有moveon
问题,但您仍在检查它的答案。
删除这部分代码:
if (!answers.moveon) {
return done();
}