Skip to content

Commit

Permalink
feat: Raise error if waved cannot find public/private dir #2130 (#2378)
Browse files Browse the repository at this point in the history
  • Loading branch information
dbranley authored Aug 5, 2024
1 parent 50fc9d9 commit dd512ac
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"io/ioutil"
"log"
"net/http"
"os"
"path"
"path/filepath"
"strings"
Expand Down Expand Up @@ -169,6 +170,10 @@ func splitDirMapping(m string) (string, string) {
panic(fmt.Sprintf("invalid directory mapping: want \"remote@local\", got %s", m))
}

if _, err := os.Stat(xs[1]); os.IsNotExist(err) {
panic(fmt.Sprintf("directory does not exist: %s", xs[1]))
}

// Windows prepends the drive letter to the path with a leading slash, e.g. "/foo/" => "C:/foo/".
if xs[0][1] == ':' {
xs[0] = xs[0][2:]
Expand Down

0 comments on commit dd512ac

Please sign in to comment.