Skip to content

Commit

Permalink
hugolib: Fix error when deleting a bundle in server mode
Browse files Browse the repository at this point in the history
Fixes #5077
  • Loading branch information
bep committed Aug 16, 2018
1 parent d999b4e commit 0a88741
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions hugolib/page_bundler_capture.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,17 @@ func (c *capturer) capturePartial(filenames ...string) error {
switch tp {
case bundleLeaf:
if err := c.handleDir(resolvedFilename); err != nil {
return err
// Directory may have been deleted.
if !os.IsNotExist(err) {
return err
}
}
case bundleBranch:
if err := c.handleBranchDir(resolvedFilename); err != nil {
return err
// Directory may have been deleted.
if !os.IsNotExist(err) {
return err
}
}
default:
fi, err := c.resolveRealPath(resolvedFilename)
Expand Down Expand Up @@ -510,7 +516,7 @@ func (c *capturer) readDir(dirname string) (pathLangFileFis, error) {

dir, err := c.fs.Open(dirname)
if err != nil {
return nil, fmt.Errorf("readDir: %s", err)
return nil, err
}
defer dir.Close()
fis, err := dir.Readdir(-1)
Expand Down

0 comments on commit 0a88741

Please sign in to comment.