mirror of
https://github.com/bettercap/bettercap
synced 2025-08-19 04:59:25 -07:00
Fix user home dir when using sudo on linux
This commit is contained in:
parent
c46bb905b9
commit
2eb00ee11a
1 changed files with 3 additions and 3 deletions
|
@ -2,11 +2,11 @@ package caplets
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"os"
|
"os"
|
||||||
"os/user"
|
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"runtime"
|
"runtime"
|
||||||
|
|
||||||
"github.com/evilsocket/islazy/str"
|
"github.com/evilsocket/islazy/str"
|
||||||
|
"github.com/mitchellh/go-homedir"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -23,8 +23,8 @@ func getInstallBase() string {
|
||||||
}
|
}
|
||||||
|
|
||||||
func getUserHomeDir() string {
|
func getUserHomeDir() string {
|
||||||
usr, _ := user.Current()
|
usr, _ := homedir.Dir()
|
||||||
return usr.HomeDir
|
return usr
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue