File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -67,6 +67,7 @@ func listCmd(vc *cmdutils.VerbCmd) {
6767func doListPlugins (vc * cmdutils.VerbCmd ) error {
6868 paths := filepath .SplitList (os .Getenv ("PATH" ))
6969 plugins := []string {}
70+ cache := make (map [string ]bool )
7071
7172 for _ , dir := range paths {
7273 files , err := ioutil .ReadDir (dir )
@@ -81,7 +82,10 @@ func doListPlugins(vc *cmdutils.VerbCmd) error {
8182 if ! hasValidPrefix (f .Name (), plugin .ValidPluginFilenamePrefixes ) {
8283 continue
8384 }
84- plugins = append (plugins , trimPrefix (f .Name (), plugin .ValidPluginFilenamePrefixes ))
85+ if ! cache [trimPrefix (f .Name (), plugin .ValidPluginFilenamePrefixes )] {
86+ cache [trimPrefix (f .Name (), plugin .ValidPluginFilenamePrefixes )] = true
87+ plugins = append (plugins , trimPrefix (f .Name (), plugin .ValidPluginFilenamePrefixes ))
88+ }
8589 }
8690 }
8791
You can’t perform that action at this time.
0 commit comments