Skip to content

Commit 1b88303

Browse files
authored
Error early on --build (#926)
1 parent 4764672 commit 1b88303

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

internal/execute/tsc.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"encoding/json"
66
"fmt"
77
"runtime"
8+
"strings"
89
"time"
910

1011
"github.com/microsoft/typescript-go/internal/ast"
@@ -19,6 +20,16 @@ import (
1920
type cbType = func(p any) any
2021

2122
func CommandLine(sys System, cb cbType, commandLineArgs []string) ExitStatus {
23+
if len(commandLineArgs) > 0 {
24+
// !!! build mode
25+
switch strings.ToLower(commandLineArgs[0]) {
26+
case "-b", "--b", "-build", "--build":
27+
fmt.Fprint(sys.Writer(), "Build mode is currently unsupported."+sys.NewLine())
28+
sys.EndWrite()
29+
return ExitStatusNotImplemented
30+
}
31+
}
32+
2233
parsedCommandLine := tsoptions.ParseCommandLine(commandLineArgs, sys)
2334
e, watcher := executeCommandLineWorker(sys, cb, parsedCommandLine)
2435
if watcher == nil {

0 commit comments

Comments
 (0)