mirror of
https://github.com/gohugoio/hugo.git
synced 2026-08-24 15:28:54 +00:00
Fix server errors when deleting static files or directories
Fixes #15174
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
# Test the hugo server command when removing a file mounted into static.
|
||||
# See issue 15174.
|
||||
|
||||
hugo server &
|
||||
|
||||
waitServer
|
||||
|
||||
rm myfiles/robots.txt
|
||||
|
||||
sleep 2
|
||||
|
||||
stopServer
|
||||
! stderr .
|
||||
|
||||
-- hugo.toml --
|
||||
title = "Hugo Server Test"
|
||||
baseURL = "https://example.org/"
|
||||
disableKinds = ["taxonomy", "term", "sitemap"]
|
||||
[[module.mounts]]
|
||||
source = "content"
|
||||
target = "content"
|
||||
[[module.mounts]]
|
||||
source = "layouts"
|
||||
target = "layouts"
|
||||
[[module.mounts]]
|
||||
source = "myfiles/robots.txt"
|
||||
target = "static/robots.txt"
|
||||
-- layouts/all.html --
|
||||
All.
|
||||
-- content/p1.md --
|
||||
-- myfiles/robots.txt --
|
||||
robots
|
||||
@@ -0,0 +1,32 @@
|
||||
# Test the hugo server command when removing a directory mounted into static.
|
||||
# See issue 15174.
|
||||
|
||||
hugo server &
|
||||
|
||||
waitServer
|
||||
|
||||
rm mystatic/foo
|
||||
|
||||
sleep 2
|
||||
|
||||
stopServer
|
||||
! stderr .
|
||||
|
||||
-- hugo.toml --
|
||||
title = "Hugo Server Test"
|
||||
baseURL = "https://example.org/"
|
||||
disableKinds = ["taxonomy", "term", "sitemap"]
|
||||
[[module.mounts]]
|
||||
source = "content"
|
||||
target = "content"
|
||||
[[module.mounts]]
|
||||
source = "layouts"
|
||||
target = "layouts"
|
||||
[[module.mounts]]
|
||||
source = "mystatic/foo"
|
||||
target = "static/foo"
|
||||
-- layouts/all.html --
|
||||
All.
|
||||
-- content/p1.md --
|
||||
-- mystatic/foo/static.txt --
|
||||
static
|
||||
Reference in New Issue
Block a user