squash-me: remove unnecessary (and very naughty) `chdir()` call

This commit is contained in:
Peter Bacon Darwin 2015-05-16 19:07:32 +01:00
parent 9d5f760597
commit a4693ef679
1 changed files with 4 additions and 3 deletions

View File

@ -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.