summaryrefslogtreecommitdiffstats
path: root/hugolib
diff options
context:
space:
mode:
authorAndreas Deininger <andreas@deininger.net>2023-05-22 18:14:10 +0200
committerGitHub <noreply@github.com>2023-05-22 18:14:10 +0200
commit9a0370e8eb71fed3ac04984020b6aa95c43f22ab (patch)
tree031150a69c18dc216321e716abcb506e10616428 /hugolib
parent10d0fcc01f77b1edad16fbdd415825731f7419fb (diff)
postcss: Improve validation of option 'config'
Diffstat (limited to 'hugolib')
-rw-r--r--hugolib/filesystems/basefs.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/hugolib/filesystems/basefs.go b/hugolib/filesystems/basefs.go
index ed0d36de1..8882ed3fe 100644
--- a/hugolib/filesystems/basefs.go
+++ b/hugolib/filesystems/basefs.go
@@ -188,19 +188,19 @@ func (b *BaseFs) AbsProjectContentDir(filename string) (string, string, error) {
// ResolveJSConfigFile resolves the JS-related config file to a absolute
// filename. One example of such would be postcss.config.js.
-func (fs *BaseFs) ResolveJSConfigFile(name string) string {
+func (fs *BaseFs) ResolveJSConfigFile(name string) (string, bool) {
// First look in assets/_jsconfig
fi, err := fs.Assets.Fs.Stat(filepath.Join(files.FolderJSConfig, name))
if err == nil {
- return fi.(hugofs.FileMetaInfo).Meta().Filename
+ return fi.(hugofs.FileMetaInfo).Meta().Filename, fi.IsDir()
}
// Fall back to the work dir.
fi, err = fs.Work.Stat(name)
if err == nil {
- return fi.(hugofs.FileMetaInfo).Meta().Filename
+ return fi.(hugofs.FileMetaInfo).Meta().Filename, fi.IsDir()
}
- return ""
+ return "", false
}
// MakePathRelative creates a relative path from the given filename.