Skip to content

Commit

Permalink
bin/lessc: Make sure path.dirname gets passed strings
Browse files Browse the repository at this point in the history
Since nodejs/node@08085c49b6e, which will be part of Node.js v6.0,
functions from the `path` core module (like `dirname`) will require
the input to be a string.

Because `.sourceMapFullFilename` and `.sourceMapInputFilename` in
bin/lessc may be `undefined`, default to passing `'.'` to
`path.dirname` instead.
  • Loading branch information
addaleax committed Mar 27, 2016
1 parent 2c974b2 commit ec04a03
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bin/lessc
Expand Up @@ -316,8 +316,8 @@ function printUsage() {
}

if (sourceMapOptions.sourceMapRootpath === undefined) {
var pathToMap = path.dirname(sourceMapFileInline ? output : sourceMapOptions.sourceMapFullFilename),
pathToInput = path.dirname(sourceMapOptions.sourceMapInputFilename);
var pathToMap = path.dirname(sourceMapFileInline ? output : sourceMapOptions.sourceMapFullFilename || '.'),
pathToInput = path.dirname(sourceMapOptions.sourceMapInputFilename || '.');
sourceMapOptions.sourceMapRootpath = path.relative(pathToMap, pathToInput);
}

Expand Down

0 comments on commit ec04a03

Please sign in to comment.