haraka / node-address-rfc2822

Parser for RFC2822 (Header) format email addresses
https://www.npmjs.com/package/address-rfc2822
53 stars 16 forks source link

Windows nearley #16

Closed msimerson closed 7 years ago

msimerson commented 7 years ago

Oh windows, why dost though need to be so retarded?

Running "nearley" task
Running: C:\Program Files (x86)\nodejs\node.exe ./node_modules/.bin/nearleyc grammar/address_format.ne -o lib/address_format.js
Fatal error: Command failed: C:\windows\system32\cmd.exe /s /c "C:\Program Files (x86)\nodejs\node.exe ./node_modules/.bin/nearleyc grammar/address_format.ne -o lib/address_format.js"
'C:\Program' is not recognized as an internal or external command,
operable program or batch file.

npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
codecov-io commented 7 years ago

Codecov Report

Merging #16 into master will not change coverage. The diff coverage is n/a.

@@           Coverage Diff           @@
##           master      #16   +/-   ##
=======================================
  Coverage   94.02%   94.02%           
=======================================
  Files           3        3           
  Lines         251      251           
  Branches       49       49           
=======================================
  Hits          236      236           
  Misses         15       15

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update c163928...ff49f34. Read the comment docs.

msimerson commented 7 years ago

I attempted to fix the grunt path quoting issue by replacing process.execPath with just 'node', which did fix one problem, but then raised another issue that I think is grunts fault:

Running "nearley" task
Running: node ./node_modules/.bin/nearleyc grammar/address_format.ne -o lib/address_format.js
Fatal error: Command failed: C:\windows\system32\cmd.exe /s /c "node ./node_modules/.bin/nearleyc grammar/address_format.ne -o lib/address_format.js"
C:\projects\node-address-rfc2822-n5mwj\node_modules\.bin\nearleyc:2
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
          ^^^^^^^
SyntaxError: missing ) after argument list

So, I showed grunt to the curb and generate the lib with a npm run compile script. If we need to compile more grammars in the future, we can write a little .js utility to handle it and then update the npm run compile target and nothing else. Fair enough?