mirror of
https://github.com/bettercap/bettercap
synced 2025-08-19 21:13:18 -07:00
Trying not to invent the wheel
This commit is contained in:
parent
2eb00ee11a
commit
4181cd1c42
1 changed files with 1 additions and 5 deletions
|
@ -5,7 +5,6 @@ import (
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"runtime"
|
|
||||||
"sort"
|
"sort"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
|
@ -26,10 +25,7 @@ func List() []*Caplet {
|
||||||
|
|
||||||
for _, fileName := range append(files, files2...) {
|
for _, fileName := range append(files, files2...) {
|
||||||
if _, err := os.Stat(fileName); err == nil {
|
if _, err := os.Stat(fileName); err == nil {
|
||||||
base := strings.Replace(fileName, searchPath+"/", "", -1)
|
base := strings.Replace(fileName, searchPath+string(os.PathSeparator), "", -1)
|
||||||
if runtime.GOOS == "windows" {
|
|
||||||
base = strings.Replace(fileName, searchPath+"\\", "", -1)
|
|
||||||
}
|
|
||||||
base = strings.Replace(base, Suffix, "", -1)
|
base = strings.Replace(base, Suffix, "", -1)
|
||||||
|
|
||||||
if err, caplet := Load(base); err != nil {
|
if err, caplet := Load(base); err != nil {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue