Skip to content

Commit 2e4c08e

Browse files
committed
Fix outdir
1 parent 921ffc2 commit 2e4c08e

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

cmd/tsgo/main.go

+6-4
Original file line numberDiff line numberDiff line change
@@ -63,16 +63,18 @@ func main() {
6363

6464
rootPath := flag.Arg(0)
6565
compilerOptions := &core.CompilerOptions{Strict: core.TSTrue, Target: core.ScriptTargetESNext, ModuleKind: core.ModuleKindNodeNext, NoEmit: core.TSTrue}
66-
if len(outDir) > 0 {
67-
compilerOptions.NoEmit = core.TSFalse
68-
compilerOptions.OutDir = outDir
69-
}
7066

7167
currentDirectory, err := os.Getwd()
7268
if err != nil {
7369
fmt.Fprintf(os.Stderr, "Error getting current directory: %v\n", err)
7470
os.Exit(1)
7571
}
72+
73+
if len(outDir) > 0 {
74+
compilerOptions.NoEmit = core.TSFalse
75+
compilerOptions.OutDir = tspath.ResolvePath(currentDirectory, outDir)
76+
}
77+
7678
fs := vfs.FromOS()
7779
useCaseSensitiveFileNames := fs.UseCaseSensitiveFileNames()
7880
host := ts.NewCompilerHost(compilerOptions, currentDirectory, fs)

0 commit comments

Comments
 (0)