Skip to content

Commit

Permalink
Handle missing esbuild dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
akclace committed Nov 17, 2023
1 parent 16deafd commit 38bd05f
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions internal/app/util/disk_fs.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,12 @@ func (d *DiskReadFS) ReadFile(name string) ([]byte, error) {
}

func (d *DiskReadFS) makeAbsolute(name string) (string, error) {
absRoot, err := filepath.Abs(d.root)
if err != nil {
return "", err
}
cleanRoot := filepath.Clean(d.root)

if !strings.HasPrefix(name, absRoot) {
if !strings.HasPrefix(name, "/") && !strings.HasPrefix(name, d.root) && !strings.HasPrefix(name, cleanRoot) {
name = path.Join(d.root, name)
}

return name, nil
}

Expand Down

0 comments on commit 38bd05f

Please sign in to comment.