mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-20 21:31:32 +02:00
Fix a rebuild on resource rename case
This commit is contained in:
@@ -184,6 +184,20 @@ func TestBatchEditScriptParam(t *testing.T) {
|
||||
b.AssertFileContent("public/mybatch/mygroup.js", "param-p1-main-edited")
|
||||
}
|
||||
|
||||
func TestBatchRenameBundledScript(t *testing.T) {
|
||||
files := jsBatchFilesTemplate
|
||||
b := hugolib.TestRunning(t, files, hugolib.TestOptWithOSFs())
|
||||
b.AssertFileContent("public/mybatch/p1.js", "P1 Script")
|
||||
b.RenameFile("content/p1/p1script.js", "content/p1/p1script2.js")
|
||||
_, err := b.BuildE()
|
||||
b.Assert(err, qt.IsNotNil)
|
||||
b.Assert(err.Error(), qt.Contains, "resource not set")
|
||||
|
||||
// Rename it back.
|
||||
b.RenameFile("content/p1/p1script2.js", "content/p1/p1script.js")
|
||||
b.Build()
|
||||
}
|
||||
|
||||
func TestBatchErrorScriptResourceNotSet(t *testing.T) {
|
||||
files := strings.Replace(jsBatchFilesTemplate, `(resources.Get "js/main.js")`, `(resources.Get "js/doesnotexist.js")`, 1)
|
||||
b, err := hugolib.TestE(t, files, hugolib.TestOptWithOSFs())
|
||||
|
Reference in New Issue
Block a user