Commit 187cfde2 by Adeel

Code: Fixes condition is-output-path-relative.

Fixes #546.
parent 67ea9c58
......@@ -36,11 +36,11 @@ function getOutFile(options) {
var outFile = options.outFile;
if (!file || !outFile || typeof outFile !== 'string' || typeof file !== 'string') {
return false;
return null;
}
if (path.resolve(outFile) !== path.normalize(outFile).replace(new RegExp(path.sep + '$'), '')) {
return false;
if (path.resolve(outFile) === path.normalize(outFile).replace(/(.+)([\/|\\])$/, '$1')) {
return outFile;
}
return path.resolve(path.dirname(file), outFile);
......@@ -135,7 +135,7 @@ function getOptions(options) {
options.data = options.data || null;
options.file = options.file || null;
options.imagePath = options.image_path || options.imagePath || '';
options.outFile = getOutFile(options) || null;
options.outFile = getOutFile(options);
options.paths = (options.include_paths || options.includePaths || []).join(path.delimiter);
options.precision = parseInt(options.precision) || 5;
options.sourceMap = getSourceMap(options);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment