mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-10 23:36:14 -05:00
Fix grunt commands to work with spaces in path
closes #3206 - We were escaping paths for the bower commands, but this didn't work on windows - Use the same pattern for the coverage command
This commit is contained in:
parent
4b83dfd6ab
commit
9293c76786
1 changed files with 8 additions and 10 deletions
18
Gruntfile.js
18
Gruntfile.js
|
@ -9,8 +9,10 @@ var path = require('path'),
|
||||||
colors = require('colors'),
|
colors = require('colors'),
|
||||||
fs = require('fs'),
|
fs = require('fs'),
|
||||||
_ = require('lodash'),
|
_ = require('lodash'),
|
||||||
buildDirectory = path.resolve(process.cwd(), '.build'),
|
escapeChar = process.platform.match(/^win/) ? '^' : '\\',
|
||||||
distDirectory = path.resolve(process.cwd(), '.dist'),
|
cwd = process.cwd().replace(' ', escapeChar + ' '),
|
||||||
|
buildDirectory = path.resolve(cwd, '.build'),
|
||||||
|
distDirectory = path.resolve(cwd, '.dist'),
|
||||||
|
|
||||||
// ## Build File Patterns
|
// ## Build File Patterns
|
||||||
// A list of files and patterns to include when creating a release zip.
|
// A list of files and patterns to include when creating a release zip.
|
||||||
|
@ -222,7 +224,7 @@ var path = require('path'),
|
||||||
// Used as part of `grunt init`. See the section on [Building Assets](#building%20assets) for more
|
// Used as part of `grunt init`. See the section on [Building Assets](#building%20assets) for more
|
||||||
// information.
|
// information.
|
||||||
bower: {
|
bower: {
|
||||||
command: path.resolve(__dirname.replace(' ', '\\ ') + '/node_modules/.bin/bower --allow-root install'),
|
command: path.resolve(cwd + '/node_modules/.bin/bower --allow-root install'),
|
||||||
options: {
|
options: {
|
||||||
stdout: true
|
stdout: true
|
||||||
}
|
}
|
||||||
|
@ -231,7 +233,7 @@ var path = require('path'),
|
||||||
// Used as part of `grunt init`. See the section on [Building Assets](#building%20assets) for more
|
// Used as part of `grunt init`. See the section on [Building Assets](#building%20assets) for more
|
||||||
// information.
|
// information.
|
||||||
ghost_ui: {
|
ghost_ui: {
|
||||||
command: path.resolve(__dirname.replace(' ', '\\ ') + '/node_modules/.bin/bower update ghost-ui'),
|
command: path.resolve(cwd + '/node_modules/.bin/bower update ghost-ui'),
|
||||||
options: {
|
options: {
|
||||||
stdout: true
|
stdout: true
|
||||||
}
|
}
|
||||||
|
@ -239,12 +241,8 @@ var path = require('path'),
|
||||||
// #### Generate coverage report
|
// #### Generate coverage report
|
||||||
// See the `grunt test-coverage` task in the section on [Testing](#testing) for more information.
|
// See the `grunt test-coverage` task in the section on [Testing](#testing) for more information.
|
||||||
coverage: {
|
coverage: {
|
||||||
command: function () {
|
command: path.resolve(cwd + '/node_modules/mocha/bin/mocha --timeout 15000 --reporter' +
|
||||||
// **Note:** will only work on windows if mocha is globally installed
|
' html-cov > coverage.html ./core/test/blanket_coverage.js'),
|
||||||
var cmd = !!process.platform.match(/^win/) ? 'mocha' : './node_modules/mocha/bin/mocha';
|
|
||||||
return cmd +
|
|
||||||
' --timeout 15000 --reporter html-cov > coverage.html ./core/test/blanket_coverage.js';
|
|
||||||
},
|
|
||||||
execOptions: {
|
execOptions: {
|
||||||
env: 'NODE_ENV=' + process.env.NODE_ENV
|
env: 'NODE_ENV=' + process.env.NODE_ENV
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue