Check for line length when scanning for local devserver url (#1566)

This commit is contained in:
Lea Anthony
2022-07-14 22:22:26 +10:00
committed by GitHub
parent f068c33dcf
commit 5987f17cca
@@ -30,6 +30,9 @@ func (s *stdoutScanner) Write(data []byte) (n int, err error) {
for sc.Scan() {
line := sc.Text()
index := strings.Index(line, "Local:")
if index == -1 || len(line) < 7 {
continue
}
line = strings.TrimSpace(line[index+6:])
viteServerURL := stripansi.Strip(line)
LogGreen("Vite Server URL: %s", viteServerURL)