Skip to content

Commit

Permalink
Merge pull request #111 from onmodulus/bug/escape-path
Browse files Browse the repository at this point in the history
fix escape path for special chars
  • Loading branch information
Matt Hernandez committed Mar 7, 2015
2 parents 2c91b66 + 0985d8e commit 20cb4dc
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions lib/demeteorizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,15 @@ const modulesNotInRegistry = [

/**
* Escapes spaces out of the specified path.
* @param {String} path The path to escape.
* @param {String} filePath The path to escape.
*/
var escapePath = function (path) {
if (!path || path.length === 0) return path;
return path.replace(/ /g, '\\ ');
var escapePath = function (filePath) {
if (!filePath || filePath.length === 0) return filePath;

filePath = filePath.replace(/ /g, '\\ ');
filePath = filePath.replace(/\(/g, '\\(');
filePath = filePath.replace(/\)/g, '\\)');
return filePath;
};

/**
Expand Down

0 comments on commit 20cb4dc

Please sign in to comment.