Update plugin.go

This commit is contained in:
Steve Gray
2016-07-31 09:25:31 +10:00
committed by GitHub
parent 94450d48f3
commit 51bb9552d3
+6 -2
View File
@@ -121,8 +121,12 @@ func writeNpmrc(config Config) error {
}
// write npmrc file
user, _ := user.Current()
npmrcPath := path.Join(user.HomeDir, ".npmrc")
home := "/root"
user, err := user.Current()
if err == nil {
home = user.HomeDir
}
npmrcPath := path.Join(home, ".npmrc")
log.WithFields(log.Fields{
"path": npmrcPath,