From d6fb6bda510777a5fe8e9e4ce842eb71afd6b32f Mon Sep 17 00:00:00 2001 From: Ice3man543 Date: Wed, 8 Jul 2020 17:25:29 +0530 Subject: [PATCH] Fixed update template issue --- v2/internal/runner/update.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/v2/internal/runner/update.go b/v2/internal/runner/update.go index cc77a743..6a63183c 100644 --- a/v2/internal/runner/update.go +++ b/v2/internal/runner/update.go @@ -62,6 +62,7 @@ func (r *Runner) writeConfiguration(config *nucleiConfig) error { return err } + config.LastChecked = time.Now() templatesConfigFile := path.Join(home, nucleiConfigFilename) file, err := os.OpenFile(templatesConfigFile, os.O_WRONLY|os.O_CREATE, 0777) if err != nil { @@ -106,7 +107,7 @@ func (r *Runner) updateTemplates() error { if r.options.TemplatesDirectory != "" { home = r.options.TemplatesDirectory } - r.templatesConfig = &nucleiConfig{TemplatesDirectory: path.Join(home, "nuclei-templates"), LastChecked: time.Now()} + r.templatesConfig = &nucleiConfig{TemplatesDirectory: path.Join(home, "nuclei-templates")} os.RemoveAll(r.templatesConfig.TemplatesDirectory) // Download the repository and also write the revision to a HEAD file. @@ -134,7 +135,6 @@ func (r *Runner) updateTemplates() error { if time.Now().Sub(r.templatesConfig.LastChecked) < 24*time.Hour && !r.options.UpdateTemplates { return nil } - r.templatesConfig.LastChecked = time.Now() // Get the configuration currently on disk. verText := r.templatesConfig.CurrentVersion