ForbesLindesay/cmd-shim — pull request #2 by basbossink (2013-04-29 01:07:22+00:00)
Title: Fix npm issue #3380.

As discussed I created a fix for the above mentioned issue. I would very much appreciate any feedback, on issues of style and/or naming conventions since this is my first delve into node. I hope you see some value in these changes and accept this request.

Fix npm issue #3380 by changing the following:
- Adapt the regular expression used to match the first
line.
- Create a simple module that can convert shell style variable
declarations: `NODE_PATH=./lib:$NODE_PATH` to the equivalent batch syntax:
`@SET=NODE_PATH=./lib:%NODE_PATH%`. Furthermore the structure of the generated
shim now looks like this:
````
@SETLOCAL

@ENDLOCAL
````
- Note that the new segments are only added to the file if there were any
variable declarations.

- The generated shell script carries over the captured variable declaration as
is.
- Add some extra tests to validate the behavior.
- Remove some unnecessary white-space in the generated shim.