Skip to content

Commit

Permalink
Merge pull request #501 from kevva/minor-fixes
Browse files Browse the repository at this point in the history
Minor tweaks
  • Loading branch information
andrew committed Oct 31, 2014
2 parents dd7f59f + 8f893cb commit 3619c1f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ function getStyle(options) {
function getSourceMap(options) {
var file = options.file;
var outFile = options.outFile;
var sourceMap = options.sourceMap;
var sourceMap = options.sourceMap || null;

if (sourceMap) {
if (typeof sourceMap !== 'string') {
Expand Down Expand Up @@ -275,7 +275,7 @@ module.exports.renderFile = function(options) {
var success = options.success;

if (options.sourceMap === true) {
options.sourceMap = options.outFile + '.map';
options.sourceMap = outFile + '.map';
}

options.success = function(css, sourceMap) {
Expand All @@ -285,18 +285,18 @@ module.exports.renderFile = function(options) {
}

if (!options.sourceMap) {
return success(options.outFile);
return success(outFile);
}

var dir = path.dirname(options.outFile);
var dir = path.dirname(outFile);
var sourceMapFile = path.resolve(dir, options.sourceMap);

fs.writeFile(sourceMapFile, sourceMap, function(err) {
if (err) {
return options.error(err);
}

success(options.outFile, sourceMapFile);
success(outFile, sourceMapFile);
});
});
};
Expand Down

0 comments on commit 3619c1f

Please sign in to comment.