cmd/tsconnect: lint during build step

Ensures that TypeScript checks pass before we deploy.

Signed-off-by: Mihai Parparita <mihai@tailscale.com>
This commit is contained in:
Mihai Parparita 2022-07-27 15:46:13 -07:00 committed by Mihai Parparita
parent d5fb852718
commit 7c3f480767
2 changed files with 10 additions and 1 deletions

View File

@ -28,6 +28,11 @@ func runBuild() {
log.Fatalf("Cannot setup: %v", err)
}
log.Printf("Linting...\n")
if err := runYarn("lint"); err != nil {
log.Fatalf("Linting failed: %v", err)
}
if err := cleanDist(); err != nil {
log.Fatalf("Cannot clean %s: %v", *distDir, err)
}

View File

@ -104,7 +104,11 @@ func buildWasm(dev bool) error {
// installJSDeps installs the JavaScript dependencies specified by package.json
func installJSDeps() error {
log.Printf("Installing JS deps...\n")
cmd := exec.Command(*yarnPath)
return runYarn()
}
func runYarn(args ...string) error {
cmd := exec.Command(*yarnPath, args...)
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
return cmd.Run()