Skip to content

Commit

Permalink
feat: Raise error if waved cannot find public/private dir h2oai#2130
Browse files Browse the repository at this point in the history
  • Loading branch information
dbranley committed Aug 2, 2024
1 parent 9b12c81 commit 32e2e2f
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 32e2e2f

Please sign in to comment.