Skip to content

Commit

Permalink
Add additional options with the good project directory, fix #525
Browse files Browse the repository at this point in the history
  • Loading branch information
ivogabe committed Dec 27, 2017
1 parent 8e87c20 commit 35733e0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ module compile {
if (fileNameOrSettings !== undefined) {
if (typeof fileNameOrSettings === 'string') {
fileName = fileNameOrSettings;
tsConfigFileName = path.resolve(process.cwd(), fileName);
projectDirectory = path.dirname(tsConfigFileName);
if (settings === undefined) settings = {};
} else {
settings = fileNameOrSettings || {};
Expand All @@ -168,9 +170,7 @@ module compile {

compilerOptions = settingsResult.options;

if (fileName) {
tsConfigFileName = path.resolve(process.cwd(), fileNameOrSettings);
projectDirectory = path.dirname(tsConfigFileName);
if (fileName !== undefined) {
let tsConfig = typescript.readConfigFile(tsConfigFileName, typescript.sys.readFile);
if (tsConfig.error) {
console.log(tsConfig.error.messageText);
Expand Down

0 comments on commit 35733e0

Please sign in to comment.