1
0
mirror of https://github.com/go-task/task.git synced 2025-02-03 13:22:11 +02:00

fix: use path/filepath instead of path (#1556)

This commit is contained in:
mattn 2024-03-21 01:00:35 +09:00 committed by GitHub
parent 696fb38f3b
commit 20e2dc7238
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -4,7 +4,7 @@ import (
"fmt"
"io"
"os"
"path"
"path/filepath"
"slices"
"strings"
"text/tabwriter"
@ -71,11 +71,11 @@ func getEnvFilePath() string {
_ = fs.Parse(os.Args[1:])
// If the directory is set, find a .env file in that directory.
if dir != "" {
return path.Join(dir, ".env")
return filepath.Join(dir, ".env")
}
// If the taskfile is set, find a .env file in the directory containing the Taskfile.
if taskfile != "" {
return path.Join(path.Dir(taskfile), ".env")
return filepath.Join(filepath.Dir(taskfile), ".env")
}
// Otherwise just use the current working directory.
return ".env"