mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-28 14:03:48 +03:00
move ember tasks over from main repository (#176)
refs TryGhost/Ghost#6977 - uses npm script's custom options to streamline ember commands - add preferLocal to shell options to allow running of npm commands
This commit is contained in:
parent
5c7093a75b
commit
8be2b44807
@ -8,10 +8,7 @@ var _ = require('lodash'),
|
||||
getTopContribs = require('top-gh-contribs'),
|
||||
moment = require('moment'),
|
||||
chalk = require('chalk'),
|
||||
Promise = require('bluebird'),
|
||||
|
||||
escapeChar = process.platform.match(/^win/) ? '^' : '\\',
|
||||
cwd = process.cwd().replace(/( |\(|\))/g, escapeChar + '$1');
|
||||
Promise = require('bluebird');
|
||||
|
||||
module.exports = function(grunt) {
|
||||
|
||||
@ -85,21 +82,61 @@ module.exports = function(grunt) {
|
||||
}
|
||||
},
|
||||
|
||||
// ### grunt-bg-shell
|
||||
// Used to run ember-cli watch in the background
|
||||
bgShell: {
|
||||
ember: {
|
||||
cmd: 'npm run build -- --watch',
|
||||
bg: true,
|
||||
stdout: function (out) {
|
||||
grunt.log.writeln(chalk.cyan('Ember-cli::') + out);
|
||||
},
|
||||
stderror: function (error) {
|
||||
grunt.log.error(chalk.red('Ember-cli::' + error));
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
shell: {
|
||||
'npm-install': {
|
||||
command: 'npm install'
|
||||
},
|
||||
|
||||
'bower-install': {
|
||||
command: path.resolve(cwd + '/node_modules/.bin/bower install')
|
||||
command: 'bower install'
|
||||
},
|
||||
|
||||
ember: {
|
||||
command: function (mode) {
|
||||
switch (mode) {
|
||||
case 'prod':
|
||||
return 'npm run build -- --environment=production --silent';
|
||||
|
||||
case 'dev':
|
||||
return 'npm run build';
|
||||
}
|
||||
},
|
||||
options: {
|
||||
execOptions: {
|
||||
stdout: false
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
csscombfix: {
|
||||
command: path.resolve(cwd + '/node_modules/.bin/csscomb -c app/styles/csscomb.json -v app/styles')
|
||||
command: 'csscomb -c app/styles/csscomb.json -v app/styles'
|
||||
},
|
||||
|
||||
csscomblint: {
|
||||
command: path.resolve(cwd + '/node_modules/.bin/csscomb -c app/styles/csscomb.json -lv app/styles')
|
||||
command: 'csscomb -c app/styles/csscomb.json -lv app/styles'
|
||||
},
|
||||
|
||||
test: {
|
||||
command: 'npm test'
|
||||
},
|
||||
|
||||
options: {
|
||||
preferLocal: true
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -76,6 +76,7 @@
|
||||
"fs-extra": "0.30.0",
|
||||
"glob": "7.0.5",
|
||||
"grunt": "1.0.1",
|
||||
"grunt-bg-shell": "2.3.3",
|
||||
"grunt-contrib-clean": "1.0.0",
|
||||
"grunt-contrib-jshint": "1.0.0",
|
||||
"grunt-jscs": "3.0.1",
|
||||
|
Loading…
Reference in New Issue
Block a user