mirror of
https://github.com/go-task/task.git
synced 2025-11-23 22:24:45 +02:00
fix: return taskrc config even if there is an error (#2461)
This commit is contained in:
@@ -33,14 +33,12 @@ var xList []Experiment
|
|||||||
|
|
||||||
func Parse(dir string) {
|
func Parse(dir string) {
|
||||||
config, _ := taskrc.GetConfig(dir)
|
config, _ := taskrc.GetConfig(dir)
|
||||||
|
|
||||||
ParseWithConfig(dir, config)
|
ParseWithConfig(dir, config)
|
||||||
}
|
}
|
||||||
|
|
||||||
func ParseWithConfig(dir string, config *ast.TaskRC) {
|
func ParseWithConfig(dir string, config *ast.TaskRC) {
|
||||||
// Read any .env files
|
// Read any .env files
|
||||||
readDotEnv(dir)
|
readDotEnv(dir)
|
||||||
|
|
||||||
// Initialize the experiments
|
// Initialize the experiments
|
||||||
GentleForce = New("GENTLE_FORCE", config, 1)
|
GentleForce = New("GENTLE_FORCE", config, 1)
|
||||||
RemoteTaskfiles = New("REMOTE_TASKFILES", config, 1)
|
RemoteTaskfiles = New("REMOTE_TASKFILES", config, 1)
|
||||||
|
|||||||
@@ -59,11 +59,11 @@ func GetConfig(dir string) (*ast.TaskRC, error) {
|
|||||||
// Find all the nodes from the given directory up to the users home directory
|
// Find all the nodes from the given directory up to the users home directory
|
||||||
absDir, err := filepath.Abs(dir)
|
absDir, err := filepath.Abs(dir)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return config, err
|
||||||
}
|
}
|
||||||
entrypoints, err := fsext.SearchAll("", absDir, defaultTaskRCs)
|
entrypoints, err := fsext.SearchAll("", absDir, defaultTaskRCs)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return config, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reverse the entrypoints since we want the child files to override parent ones
|
// Reverse the entrypoints since we want the child files to override parent ones
|
||||||
|
|||||||
Reference in New Issue
Block a user