From 0ee9b163b9747a7d911d795f4653476425e293a1 Mon Sep 17 00:00:00 2001 From: Ke Zhu Date: Sun, 4 May 2014 22:05:24 -0400 Subject: [PATCH] correct npm publish logic --- pkg/plugin/publish/npm.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/plugin/publish/npm.go b/pkg/plugin/publish/npm.go index 42b26165..d31879ed 100644 --- a/pkg/plugin/publish/npm.go +++ b/pkg/plugin/publish/npm.go @@ -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)) } \ No newline at end of file