Skip to content

Commit 566a82a

Browse files
committed
adding absolute path
1 parent bce92ad commit 566a82a

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

internal/runner/options.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package runner
33
import (
44
"flag"
55
"os"
6+
"path/filepath"
67
"strings"
78

89
"github.com/projectdiscovery/gologger"
@@ -91,3 +92,11 @@ func (options *Options) configureOutput() {
9192
gologger.DefaultLogger.SetMaxLevel(levels.LevelSilent)
9293
}
9394
}
95+
96+
func (o Options) FolderAbsPath() string {
97+
abspath, err := filepath.Abs(o.Folder)
98+
if err != nil {
99+
return o.Folder
100+
}
101+
return abspath
102+
}

internal/runner/runner.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,11 @@ func (r *Runner) Run() error {
7272
}
7373

7474
if r.options.HTTPS {
75-
gologger.Print().Msgf("Serving %s on https://%s/...", r.options.Folder, r.options.ListenAddress)
75+
gologger.Print().Msgf("Serving %s on https://%s/", r.options.FolderAbsPath(), r.options.ListenAddress)
7676
return r.httpServer.ListenAndServeTLS()
7777
}
7878

79-
gologger.Print().Msgf("Serving %s on http://%s/...", r.options.Folder, r.options.ListenAddress)
79+
gologger.Print().Msgf("Serving %s on http://%s/", r.options.FolderAbsPath(), r.options.ListenAddress)
8080
return r.httpServer.ListenAndServe()
8181
}
8282

0 commit comments

Comments
 (0)