Skip to content

Commit

Permalink
use fileutil to create folder
Browse files Browse the repository at this point in the history
  • Loading branch information
tarunKoyalwar committed Jul 20, 2023
1 parent 54bf87f commit 346cac1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions v2/pkg/reporting/exporters/markdown/markdown.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@ package markdown

import (
"bytes"
"github.com/projectdiscovery/gologger"
"os"
"path/filepath"
"strings"

"github.com/projectdiscovery/gologger"

"github.com/projectdiscovery/nuclei/v2/pkg/output"
"github.com/projectdiscovery/nuclei/v2/pkg/reporting/exporters/markdown/util"
"github.com/projectdiscovery/nuclei/v2/pkg/reporting/format"
fileutil "github.com/projectdiscovery/utils/file"
stringsutil "github.com/projectdiscovery/utils/strings"
)

Expand Down Expand Up @@ -94,8 +96,7 @@ func (exporter *Exporter) Export(event *output.ResultEvent) error {
fileUrl = filepath.Join(subdirectory, filename)

// Create the subdirectory if it does not exist
err = os.MkdirAll(filepath.Join(exporter.directory, subdirectory), 0755)
if err != nil {
if err = fileutil.CreateFolders(filepath.Join(exporter.directory, subdirectory)); err != nil {
gologger.Warning().Msgf("Could not create subdirectory for markdown report: %s", err)
}
}
Expand Down

0 comments on commit 346cac1

Please sign in to comment.