mirror of
https://github.com/bettercap/bettercap
synced 2025-08-20 13:33:21 -07:00
added Windows basepath to UI setup
This commit is contained in:
parent
118a348e3e
commit
58f4214756
1 changed files with 16 additions and 4 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"
|
||||||
|
|
||||||
|
@ -35,10 +36,21 @@ func NewUIModule(s *session.Session) *UIModule {
|
||||||
client: github.NewClient(nil),
|
client: github.NewClient(nil),
|
||||||
}
|
}
|
||||||
|
|
||||||
mod.AddParam(session.NewStringParameter("ui.basepath",
|
var basePath *session.ModuleParam
|
||||||
"/usr/local/share/bettercap/",
|
|
||||||
"",
|
if runtime.GOOS == "windows" {
|
||||||
"UI base installation path."))
|
basePath = session.NewStringParameter("ui.basepath",
|
||||||
|
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