diff options
author | Bjørn Erik Pedersen <[email protected]> | 2023-05-22 20:31:59 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2023-05-22 20:31:59 +0200 |
commit | bd38e35f97a8fd1a369eb35b4aaba6efdb5e83af (patch) | |
tree | ad599155fa87fed3f9e9b8123c16db2e3c1a80bd /resources/resource_transformers | |
parent | 85b13c105a202baf80796a5eab144d3f74a4cc42 (diff) | |
download | hugo-bd38e35f97a8fd1a369eb35b4aaba6efdb5e83af.tar.gz hugo-bd38e35f97a8fd1a369eb35b4aaba6efdb5e83af.zip |
Revert "postcss: Improve validation of option 'config'"
This reverts commit 9a0370e8eb71fed3ac04984020b6aa95c43f22ab.
Closes #10990
Diffstat (limited to 'resources/resource_transformers')
-rw-r--r-- | resources/resource_transformers/babel/babel.go | 8 | ||||
-rw-r--r-- | resources/resource_transformers/postcss/postcss.go | 8 |
2 files changed, 4 insertions, 12 deletions
diff --git a/resources/resource_transformers/babel/babel.go b/resources/resource_transformers/babel/babel.go index 5ed09d200..ff19d9dda 100644 --- a/resources/resource_transformers/babel/babel.go +++ b/resources/resource_transformers/babel/babel.go @@ -134,17 +134,13 @@ func (t *babelTransformation) Transform(ctx *resources.ResourceTransformationCtx } configFile = filepath.Clean(configFile) - isConfigFileDir := false // We need an absolute filename to the config file. if !filepath.IsAbs(configFile) { - configFile, isConfigFileDir = t.rs.BaseFs.ResolveJSConfigFile(configFile) - if isConfigFileDir { - logger.Warnf("babel config %q must be a file, not a directory", configFile) - } + configFile = t.rs.BaseFs.ResolveJSConfigFile(configFile) if configFile == "" && t.options.Config != "" { // Only fail if the user specified config file is not found. - return fmt.Errorf("babel config file %q not found", configFile) + return fmt.Errorf("babel config %q not found:", configFile) } } diff --git a/resources/resource_transformers/postcss/postcss.go b/resources/resource_transformers/postcss/postcss.go index ee3f39be1..376d72182 100644 --- a/resources/resource_transformers/postcss/postcss.go +++ b/resources/resource_transformers/postcss/postcss.go @@ -172,17 +172,13 @@ func (t *postcssTransformation) Transform(ctx *resources.ResourceTransformationC } configFile = filepath.Clean(configFile) - isConfigFileDir := false // We need an absolute filename to the config file. if !filepath.IsAbs(configFile) { - configFile, isConfigFileDir = t.rs.BaseFs.ResolveJSConfigFile(configFile) + configFile = t.rs.BaseFs.ResolveJSConfigFile(configFile) if configFile == "" && options.Config != "" { // Only fail if the user specified config file is not found. - return fmt.Errorf("postcss config directory %q not found", options.Config) - } - if !isConfigFileDir { - logger.Warnf("postcss config %q must be a directory", options.Config) + return fmt.Errorf("postcss config %q not found:", options.Config) } } |