From a4693ef67916efa97d05a13f01eae591dde6b293 Mon Sep 17 00:00:00 2001 From: Peter Bacon Darwin Date: Sat, 16 May 2015 19:07:32 +0100 Subject: [PATCH] squash-me: remove unnecessary (and very naughty) `chdir()` call --- docs/dgeni-package/services/tsParser.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/dgeni-package/services/tsParser.js b/docs/dgeni-package/services/tsParser.js index e21d2947f8..ace2e746d1 100644 --- a/docs/dgeni-package/services/tsParser.js +++ b/docs/dgeni-package/services/tsParser.js @@ -1,4 +1,5 @@ var ts = require('typescript'); +var path = require('canonical-path'); module.exports = function tsParser(createCompilerHost, log) { @@ -9,9 +10,9 @@ module.exports = function tsParser(createCompilerHost, log) { }, parse: function(fileNames, baseDir) { - // This is the easiest way I could find to ensure that we loaded - // modules with paths relative to the baseDir - process.chdir(baseDir); + fileNames = fileNames.map(function(fileName) { + return path.resolve(baseDir, fileName); + }); // "Compile" a program from the given module filenames, to get hold of a // typeChecker that can be used to interrogate the modules, exports and so on.