Skip to content

Commit 930b67f

Browse files
committed
up 2023-09-01
1 parent f14472e commit 930b67f

File tree

1 file changed

+22
-9
lines changed

1 file changed

+22
-9
lines changed

lib/util/config.go

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -537,15 +537,7 @@ func RegInitFunc4Hd(cbk func()) {
537537
func DoInit(config *embed.FS) {
538538
Init1(config)
539539
rand.Seed(time.Now().UnixNano())
540-
var wg sync.WaitGroup
541-
for _, x := range []string{"nuclei", "naabu", "httpx", "dnsx", "subfinder", "katana", "uncover", "tlsx"} {
542-
wg.Add(1)
543-
go func(s string) {
544-
defer wg.Done()
545-
util1.UpdateScan4allVersionToLatest(true, "projectdiscovery", s, util1.SzPwd+"/config/"+runtime.GOOS+"/")
546-
}(x)
547-
}
548-
wg.Wait()
540+
549541
// log.Println("start init for fnInitHd ", len(fnInitHd))
550542
// for _, x := range fnInitHd {
551543
// x()
@@ -568,6 +560,27 @@ func DoInit(config *embed.FS) {
568560
}
569561
fnInit = nil
570562
fnInitHd = nil
563+
var wg sync.WaitGroup
564+
if "" == util1.SzPwd {
565+
if s, err := os.Getwd(); nil == err {
566+
util1.SzPwd = s
567+
}
568+
}
569+
if "" == util1.SzPwd {
570+
util1.SzPwd = "."
571+
}
572+
szPath := util1.SzPwd + "/config/" + runtime.GOOS
573+
if err := os.MkdirAll(szPath, os.ModePerm); nil != err {
574+
log.Println(err, szPath)
575+
}
576+
for _, x := range []string{"nuclei", "naabu", "httpx", "dnsx", "subfinder", "katana", "uncover", "tlsx"} {
577+
wg.Add(1)
578+
go func(s string) {
579+
defer wg.Done()
580+
util1.UpdateScan4allVersionToLatest(true, "projectdiscovery", s, szPath)
581+
}(x)
582+
}
583+
wg.Wait()
571584
}
572585

573586
func RemoveDuplication_map(arr []string) []string {

0 commit comments

Comments
 (0)