mixu / markdown-styles

Markdown to static HTML generator and multiple CSS themes for Markdown
1.85k stars 251 forks source link

Update resolve-args.js #38

Closed maximumstock closed 8 years ago

maximumstock commented 8 years ago

Hi,

it seems like in node.js 6.x, path.dirname() requires a string as argument and throws an error otherwise. On v6.0.0 I get:

path.js:7
    throw new TypeError('Path must be a string. Received ' + inspect(path));
    ^

TypeError: Path must be a string. Received undefined
    at assertPath (path.js:7:11)
    at Object.dirname (path.js:1324:5)
    at module.exports (/Users/maximumstock/dev/hex/hexsales-api/node_modules/markdown-styles/lib/resolve-args.js:51:24)

To not have any side effects, I just added some type checking for at line 51, which invokes path.dirname(argv.template) which will always be undefined because of line 19.

Edit: Here are the links to the documentation: 5.11 - 6.0.0

mixu commented 8 years ago

thanks! merged

mixu commented 8 years ago

published as v3.1.6