|
|
@ -68,6 +68,7 @@ func Run(cmd *cobra.Command, args []string) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func findCMD(base string) (string, []string, error) { |
|
|
|
func findCMD(base string) (string, []string, error) { |
|
|
|
|
|
|
|
var root bool |
|
|
|
next := func(dir string) (string, []string, error) { |
|
|
|
next := func(dir string) (string, []string, error) { |
|
|
|
var ( |
|
|
|
var ( |
|
|
|
cmdDir string |
|
|
|
cmdDir string |
|
|
@ -88,6 +89,9 @@ func findCMD(base string) (string, []string, error) { |
|
|
|
cmdDir = filepath.Join(walkPath, "..") |
|
|
|
cmdDir = filepath.Join(walkPath, "..") |
|
|
|
return nil |
|
|
|
return nil |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if info.Name() == "go.mod" { |
|
|
|
|
|
|
|
root = true |
|
|
|
|
|
|
|
} |
|
|
|
return nil |
|
|
|
return nil |
|
|
|
}) |
|
|
|
}) |
|
|
|
return cmdDir, cmdPath, err |
|
|
|
return cmdDir, cmdPath, err |
|
|
@ -100,6 +104,9 @@ func findCMD(base string) (string, []string, error) { |
|
|
|
if len(res) > 0 { |
|
|
|
if len(res) > 0 { |
|
|
|
return cmdDir, res, nil |
|
|
|
return cmdDir, res, nil |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if root { |
|
|
|
|
|
|
|
break |
|
|
|
|
|
|
|
} |
|
|
|
base = filepath.Join(base, "..") |
|
|
|
base = filepath.Join(base, "..") |
|
|
|
} |
|
|
|
} |
|
|
|
return "", []string{base}, nil |
|
|
|
return "", []string{base}, nil |
|
|
|