Skip to content

Commit

Permalink
Fix the issue of deploying process
Browse files Browse the repository at this point in the history
  • Loading branch information
KateKate committed Nov 10, 2015
1 parent 7f9e029 commit bf7a52c
Show file tree
Hide file tree
Showing 4 changed files with 107 additions and 98 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ To find out more about Slush, check out the [documentation](https://github.com/s

## Change log

#### 0.1.2

* Remove ES6 from slushfile so it inovoked the problem of deploying process.

#### 0.1.1

* Update dependencies for the slush app.
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "slush-spa",
"description": "SPA creation",
"version": "0.1.1",
"version": "0.1.2",
"homepage": "https://github.com/KateKate/slush-spa",
"author": {
"name": "Kate Anishkina",
Expand Down Expand Up @@ -29,7 +29,6 @@
"test": "echo \"No tests\""
},
"dependencies": {
"babel": "^5.8.29",
"gulp": "^3.6.2",
"gulp-conflict": "^0.3.0",
"gulp-install": "^0.3.0",
Expand Down
104 changes: 102 additions & 2 deletions slushfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,105 @@
* Copyright (c) 2015, Kate Anishkina
* Licensed under the MIT license.
*/
require('babel/register');
require('./slushtasks.js');

'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'),
path = require('path');


function format(string) {
var username = string.toLowerCase();
return username.replace(/\s/g, '');
}


var defaults = (function () {
var workingDirName = path.basename(process.cwd());
var homeDir;
var osUserName;
var configFile;
var user = {};

if (process.platform === 'win32') {
homeDir = process.env.USERPROFILE;
osUserName = process.env.USERNAME || path.basename(homeDir).toLowerCase();
}
else {
homeDir = process.env.HOME || process.env.HOMEPATH;
osUserName = homeDir && homeDir.split('/').pop() || 'root';
}

configFile = path.join(homeDir, '.gitconfig');

if (require('fs').existsSync(configFile)) {
user = require('iniparser').parseSync(configFile).user;
}

return {
appName: workingDirName,
userName: osUserName || format(user.name || ''),
authorName: user.name || '',
authorEmail: user.email || ''
};
})();


gulp.task('default', function (done) {
var prompts = [{
name: 'appName',
message: 'What is the name of your application?',
default: defaults.appName
}, {
name: 'appDescription',
message: 'What is the description?'
}, {
name: 'appVersion',
message: 'What is the version of your application?',
default: '0.1.0'
}, {
name: 'authorName',
message: 'What is the author name?',
default: defaults.authorName
}, {
name: 'authorEmail',
message: 'What is the author email?',
default: defaults.authorEmail
}, {
name: 'userName',
message: 'What is the github username?',
default: defaults.userName
}, {
type: 'confirm',
name: 'moveon',
message: 'Continue?'
}];
//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();
});
}
);
});
94 changes: 0 additions & 94 deletions slushtasks.js

This file was deleted.

0 comments on commit bf7a52c

Please sign in to comment.