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:
parent
696fb38f3b
commit
20e2dc7238
@ -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"
|
||||
|
Loading…
x
Reference in New Issue
Block a user