Skip to content

Commit

Permalink
hitsumabushi: bug fix: fs.Sub didn't cause a not-found error
Browse files Browse the repository at this point in the history
  • Loading branch information
hajimehoshi committed Feb 10, 2024
1 parent ae3cd3f commit 2be0a75
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion overlay.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,19 @@ func GenOverlayJSON(options ...Option) ([]byte, error) {
}

root := goVersion() + "_" + cfg.os
subFiles, err := fs.Sub(patchFiles, root)
dir, err := patchFiles.Open(root)
if err != nil {
if errors.Is(err, fs.ErrNotExist) {
return nil, fmt.Errorf("hitsumabushi: Hitsumabushi does not support the Go version %s and GOOS=%s", runtime.Version(), cfg.os)
}
return nil, err
}
dir.Close()

subFiles, err := fs.Sub(patchFiles, root)
if err != nil {
return nil, err
}

tmpDir := cfg.overlayDir
if tmpDir == "" {
Expand Down

0 comments on commit 2be0a75

Please sign in to comment.