Cucumber.js is supplying a command-line "binary" which is a simple .js
file containing a shebang instruction:
#!/usr/bin/env node
var Cucumber = require('../lib/cucumber');
// ...
The binary is specified in package.json
with the "bin"
configuration key:
{ "name" : "cucumber"
, "description" : "The official JavaScript implementation of Cucumber."
// ...
, "bin": { "cucumber.js": "./bin/cucumber.js" }
// ...
This all works well on POSIX systems. Someone reported an issue when running Cucumber.js on Windows.
Basically, the .js
file seems to be executed through the JScript interpreter of Windows (not Node.js) and it throws a syntax error because of the shebang instruction.
My question is: what is the recommended way of setting up a "binary" script that works on both UNIX and Windows systems?
Thanks.
cucumber.js
and acucumber.js.cmd
windows-friendly binaries based on the "bin" configuration instruction. Because of how Windows handles file "extensions", when one typednode_modules\.bin\cucumber.js
it was running the.js
file through JScript instead of the.cmd
file. Thanks for the pedantic postscript ;) – Olimpia