update npm login method

This commit is contained in:
Ke Zhu 2014-05-04 21:48:03 -04:00
parent d0628bbe7b
commit d77b3209b0
2 changed files with 4 additions and 8 deletions

View file

@ -6,11 +6,11 @@ import (
"github.com/drone/drone/pkg/build/buildfile"
)
// use npm trick instead of running npm adduser that requires stdin
var npmLoginCmd = `
npm login <<EOF
%s
%s
%s
cat <<EOF > ~/.npmrc
_auth = $(echo "%s:%s" | tr -d "\r\n" | base64)
email = %s
EOF
`

View file

@ -59,10 +59,6 @@ func TestNPMPublish(t *testing.T) {
t.Fatalf("Can't unmarshal publish script: %s", err)
}
if !strings.Contains(bscr, "npm login") {
t.Error("Expect script to contain login command")
}
if !strings.Contains(bscr, "npm publish") {
t.Error("Expect script to contain install command")
}