Run integration test with node handlebars -a ... on Windows

Fixes #1233

NodeJS files cannot be executed directly on Windows.
This commit is contained in:
Nils Knappmeier
2017-05-14 23:10:14 +02:00
parent bdfdbea09c
commit 2e21e2bc9a
+5 -2
View File
@@ -1,11 +1,14 @@
var childProcess = require('child_process'), var childProcess = require('child_process'),
fs = require('fs'); fs = require('fs'),
os = require('os');
module.exports = function(grunt) { module.exports = function(grunt) {
grunt.registerTask('test:bin', function() { grunt.registerTask('test:bin', function() {
var done = this.async(); var done = this.async();
childProcess.exec('./bin/handlebars -a spec/artifacts/empty.handlebars', function(err, stdout) { // On Windows, the executable handlebars.js file cannot be run directly
var prefix = os.type().match(/^Windows/) ? process.argv[0] : '';
childProcess.exec(prefix + ' ./bin/handlebars -a spec/artifacts/empty.handlebars', function(err, stdout) {
if (err) { if (err) {
throw err; throw err;
} }