aboutsummaryrefslogtreecommitdiffhomepage
path: root/hugolib/filesystems
diff options
context:
space:
mode:
authorAndreas Deininger <[email protected]>2023-05-22 18:14:10 +0200
committerGitHub <[email protected]>2023-05-22 18:14:10 +0200
commit9a0370e8eb71fed3ac04984020b6aa95c43f22ab (patch)
tree031150a69c18dc216321e716abcb506e10616428 /hugolib/filesystems
parent10d0fcc01f77b1edad16fbdd415825731f7419fb (diff)
downloadhugo-9a0370e8eb71fed3ac04984020b6aa95c43f22ab.tar.gz
hugo-9a0370e8eb71fed3ac04984020b6aa95c43f22ab.zip
postcss: Improve validation of option 'config'
Diffstat (limited to 'hugolib/filesystems')
-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.