Skip to content

Commit dd512ac

Browse files
authored
feat: Raise error if waved cannot find public/private dir #2130 (#2378)
1 parent 50fc9d9 commit dd512ac

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

server.go

+5
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import (
2222
"io/ioutil"
2323
"log"
2424
"net/http"
25+
"os"
2526
"path"
2627
"path/filepath"
2728
"strings"
@@ -169,6 +170,10 @@ func splitDirMapping(m string) (string, string) {
169170
panic(fmt.Sprintf("invalid directory mapping: want \"remote@local\", got %s", m))
170171
}
171172

173+
if _, err := os.Stat(xs[1]); os.IsNotExist(err) {
174+
panic(fmt.Sprintf("directory does not exist: %s", xs[1]))
175+
}
176+
172177
// Windows prepends the drive letter to the path with a leading slash, e.g. "/foo/" => "C:/foo/".
173178
if xs[0][1] == ':' {
174179
xs[0] = xs[0][2:]

0 commit comments

Comments
 (0)