mirror of
https://github.com/go-task/task.git
synced 2025-11-23 22:24:45 +02:00
fix: Print dotenv file path when there is an error reading file (#1842)
This commit is contained in:
committed by
GitHub
parent
e619bad4a9
commit
8d0f0b049c
@@ -1,6 +1,7 @@
|
||||
package taskfile
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/joho/godotenv"
|
||||
@@ -37,7 +38,7 @@ func Dotenv(c *compiler.Compiler, tf *ast.Taskfile, dir string) (*ast.Vars, erro
|
||||
|
||||
envs, err := godotenv.Read(dotEnvPath)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return nil, fmt.Errorf("error reading env file %s: %w", dotEnvPath, err)
|
||||
}
|
||||
for key, value := range envs {
|
||||
if ok := env.Exists(key); !ok {
|
||||
|
||||
Reference in New Issue
Block a user