Skip to content

Commit

Permalink
Merge pull request #32 from motemen/uncgo-homedir
Browse files Browse the repository at this point in the history
use go-homedir for distributing compiled binaries
  • Loading branch information
motemen committed Aug 23, 2014
2 parents 3b3ab42 + 64b5b8e commit 7ed4e52
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions local_repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import (
"fmt"
"net/url"
"os"
"os/user"
"path"
"path/filepath"
"strings"

"github.com/mitchellh/go-homedir"
"github.com/motemen/ghq/utils"
)

Expand Down Expand Up @@ -170,10 +170,10 @@ func localRepositoryRoots() []string {
utils.PanicIf(err)

if len(_localRepositoryRoots) == 0 {
usr, err := user.Current()
homeDir, err := homedir.Dir()
utils.PanicIf(err)

_localRepositoryRoots = []string{filepath.Join(usr.HomeDir, ".ghq")}
_localRepositoryRoots = []string{filepath.Join(homeDir, ".ghq")}
}

for i, v := range _localRepositoryRoots {
Expand Down

0 comments on commit 7ed4e52

Please sign in to comment.