mirror of
https://github.com/harness/drone.git
synced 2025-05-10 05:01:41 +08:00
update npm login method
This commit is contained in:
parent
d0628bbe7b
commit
d77b3209b0
@ -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
|
||||
`
|
||||
|
||||
|
@ -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")
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user