mirror of
https://github.com/bettercap/bettercap
synced 2025-07-30 19:50:06 -07:00
fix undefined: usr bug in core
The following fixes the issue for me when I run the following test: $ go test -v -run=TestCoreExpandPath ./core
This commit is contained in:
parent
eaa5dab166
commit
f623505816
1 changed files with 2 additions and 1 deletions
|
@ -89,7 +89,8 @@ func ExpandPath(path string) (string, error) {
|
|||
// Check if path is empty
|
||||
if path != "" {
|
||||
if strings.HasPrefix(path, "~") {
|
||||
if usr, err := user.Current(); err != nil {
|
||||
usr, err := user.Current()
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
// Replace only the first occurrence of ~
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue