mirror of
https://github.com/drone-plugins/drone-npm.git
synced 2026-06-04 18:23:52 +08:00
Update plugin.go
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user