Skip to content

Commit

Permalink
Run integration test with node handlebars -a ... on Windows
Browse files Browse the repository at this point in the history
Fixes #1233

NodeJS files cannot be executed directly on Windows.
  • Loading branch information
nknapp committed May 14, 2017
1 parent bdfdbea commit 2e21e2b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tasks/test.js
@@ -1,11 +1,14 @@
var childProcess = require('child_process'),
fs = require('fs');
fs = require('fs'),
os = require('os');

module.exports = function(grunt) {
grunt.registerTask('test:bin', function() {
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) {
throw err;
}
Expand Down

0 comments on commit 2e21e2b

Please sign in to comment.