mirror of
https://github.com/bettercap/bettercap
synced 2025-08-14 02:36:57 -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 (
|
||||
"os"
|
||||
"os/user"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
|
||||
"github.com/evilsocket/islazy/str"
|
||||
"github.com/mitchellh/go-homedir"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -23,8 +23,8 @@ func getInstallBase() string {
|
|||
}
|
||||
|
||||
func getUserHomeDir() string {
|
||||
usr, _ := user.Current()
|
||||
return usr.HomeDir
|
||||
usr, _ := homedir.Dir()
|
||||
return usr
|
||||
}
|
||||
|
||||
var (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue