Skip to content

Commit 8f55bc9

Browse files
rahearnrobdimsdale
authored andcommitted
Add .manifest.json to list of files indicating local asset precompilaiton
Default for Rails 8's propshaft
1 parent a1eb207 commit 8f55bc9

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

src/ruby/finalize/finalize.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ func (f *Finalizer) databaseUrl() string {
214214
}
215215

216216
func (f *Finalizer) hasPrecompiledAssets() (bool, error) {
217-
globs := []string{".sprockets-manifest-*.json", "manifest-*.json"}
217+
globs := []string{".sprockets-manifest-*.json", "manifest-*.json", ".manifest.json"}
218218
if f.RailsVersion < 4 {
219219
globs = []string{"manifest.yml"}
220220
}

src/ruby/finalize/finalize_test.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,17 @@ var _ = Describe("Finalize", func() {
356356
Expect(buffer.String()).To(ContainSubstring("Detected assets manifest file, assuming assets were compiled locally"))
357357
})
358358
})
359+
Context("public/assets/.manifest.json is present", func() {
360+
BeforeEach(func() {
361+
Expect(os.MkdirAll(filepath.Join(buildDir, "public", "assets"), 0755)).To(Succeed())
362+
Expect(ioutil.WriteFile(filepath.Join(buildDir, "public", "assets", ".manifest.json"), []byte("memanifest"), 0644)).To(Succeed())
363+
})
364+
It("skips assets:precompile", func() {
365+
Expect(finalizer.PrecompileAssets()).To(Succeed())
366+
Expect(cmds).To(BeEmpty())
367+
Expect(buffer.String()).To(ContainSubstring("Detected assets manifest file, assuming assets were compiled locally"))
368+
})
369+
})
359370
Context("public/assets/manifest.yml is present", func() {
360371
BeforeEach(func() {
361372
Expect(os.MkdirAll(filepath.Join(buildDir, "public", "assets"), 0755)).To(Succeed())

0 commit comments

Comments
 (0)