mirror of
https://github.com/bettercap/bettercap
synced 2025-08-20 21:43:18 -07:00
Merge pull request #892 from antipopp/master
UI hardcoded setup path changed to handle Windows installation
This commit is contained in:
commit
c1770b3aa6
1 changed files with 9 additions and 1 deletions
|
@ -9,6 +9,7 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"regexp"
|
"regexp"
|
||||||
|
"runtime"
|
||||||
|
|
||||||
"github.com/bettercap/bettercap/session"
|
"github.com/bettercap/bettercap/session"
|
||||||
|
|
||||||
|
@ -29,6 +30,13 @@ type UIModule struct {
|
||||||
uiPath string
|
uiPath string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func getDefaultInstallBase() string {
|
||||||
|
if runtime.GOOS == "windows" {
|
||||||
|
return filepath.Join(os.Getenv("ALLUSERSPROFILE"), "bettercap")
|
||||||
|
}
|
||||||
|
return "/usr/local/share/bettercap/"
|
||||||
|
}
|
||||||
|
|
||||||
func NewUIModule(s *session.Session) *UIModule {
|
func NewUIModule(s *session.Session) *UIModule {
|
||||||
mod := &UIModule{
|
mod := &UIModule{
|
||||||
SessionModule: session.NewSessionModule("ui", s),
|
SessionModule: session.NewSessionModule("ui", s),
|
||||||
|
@ -36,7 +44,7 @@ func NewUIModule(s *session.Session) *UIModule {
|
||||||
}
|
}
|
||||||
|
|
||||||
mod.AddParam(session.NewStringParameter("ui.basepath",
|
mod.AddParam(session.NewStringParameter("ui.basepath",
|
||||||
"/usr/local/share/bettercap/",
|
getDefaultInstallBase(),
|
||||||
"",
|
"",
|
||||||
"UI base installation path."))
|
"UI base installation path."))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue