correct npm publish logic

This commit is contained in:
Ke Zhu 2014-05-04 22:05:24 -04:00
parent d77b3209b0
commit 0ee9b163b9

View file

@ -51,11 +51,6 @@ func (n *NPM) Write(f *buildfile.Buildfile) {
npmPublishCmd := "npm publish %s"
// Setup custom npm registry
if n.Registry != "" {
f.WriteCmdSilent(fmt.Sprintf("npm config set registry %s", n.Registry))
}
if n.Tag != "" {
npmPublishCmd += fmt.Sprintf(" --tag %s", n.Tag)
}
@ -69,5 +64,10 @@ func (n *NPM) Write(f *buildfile.Buildfile) {
// Login to registry
f.WriteCmdSilent(fmt.Sprintf(npmLoginCmd, n.Username, n.Password, n.Email))
// Setup custom npm registry
if n.Registry != "" {
f.WriteCmdSilent(fmt.Sprintf("npm config set registry %s", n.Registry))
}
f.WriteCmd(fmt.Sprintf(npmPublishCmd, n.Folder))
}