Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

Commit

Permalink
move ember tasks over from main repository
Browse files Browse the repository at this point in the history
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
  • Loading branch information
acburdine committed Aug 3, 2016
1 parent 87a1bb2 commit e82079a
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 7 deletions.
51 changes: 44 additions & 7 deletions Gruntfile.js
Expand Up @@ -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) {

Expand Down Expand Up @@ -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
}
}
});
Expand Down
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -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",
Expand Down

0 comments on commit e82079a

Please sign in to comment.