mirror of
https://github.com/bettercap/bettercap
synced 2025-08-19 04:59:25 -07:00
added Windows basepath to UI setup
This commit is contained in:
parent
58f4214756
commit
f10159ec19
1 changed files with 11 additions and 15 deletions
|
@ -30,27 +30,23 @@ 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),
|
||||||
client: github.NewClient(nil),
|
client: github.NewClient(nil),
|
||||||
}
|
}
|
||||||
|
|
||||||
var basePath *session.ModuleParam
|
mod.AddParam(session.NewStringParameter("ui.basepath",
|
||||||
|
getDefaultInstallBase(),
|
||||||
if runtime.GOOS == "windows" {
|
"",
|
||||||
basePath = session.NewStringParameter("ui.basepath",
|
"UI base installation path."))
|
||||||
filepath.Join(os.Getenv("ALLUSERSPROFILE"), "bettercap"),
|
|
||||||
"",
|
|
||||||
"UI base installation path.")
|
|
||||||
} else {
|
|
||||||
basePath = session.NewStringParameter("ui.basepath",
|
|
||||||
"/usr/local/share/bettercap/",
|
|
||||||
"",
|
|
||||||
"UI base installation path.")
|
|
||||||
}
|
|
||||||
|
|
||||||
mod.AddParam(basePath)
|
|
||||||
|
|
||||||
mod.AddParam(session.NewStringParameter("ui.tmpfile",
|
mod.AddParam(session.NewStringParameter("ui.tmpfile",
|
||||||
filepath.Join(os.TempDir(), "ui.zip"),
|
filepath.Join(os.TempDir(), "ui.zip"),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue