Fix user home dir when using sudo on linux

This commit is contained in:
realgam3 2019-09-06 17:56:36 +03:00
commit 2eb00ee11a

View file

@ -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 (