From 2e21e2bc9a19c2be258c98a0c5c97e0f74228315 Mon Sep 17 00:00:00 2001 From: Nils Knappmeier Date: Sun, 14 May 2017 23:10:14 +0200 Subject: [PATCH] Run integration test with `node handlebars -a ...` on Windows Fixes #1233 NodeJS files cannot be executed directly on Windows. --- tasks/test.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tasks/test.js b/tasks/test.js index d7ce04d0a..e7825d015 100644 --- a/tasks/test.js +++ b/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; }