update npm login method
This commit is contained in:
parent
d0628bbe7b
commit
d77b3209b0
2 changed files with 4 additions and 8 deletions
|
@ -6,11 +6,11 @@ import (
|
||||||
"github.com/drone/drone/pkg/build/buildfile"
|
"github.com/drone/drone/pkg/build/buildfile"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// use npm trick instead of running npm adduser that requires stdin
|
||||||
var npmLoginCmd = `
|
var npmLoginCmd = `
|
||||||
npm login <<EOF
|
cat <<EOF > ~/.npmrc
|
||||||
%s
|
_auth = $(echo "%s:%s" | tr -d "\r\n" | base64)
|
||||||
%s
|
email = %s
|
||||||
%s
|
|
||||||
EOF
|
EOF
|
||||||
`
|
`
|
||||||
|
|
||||||
|
|
|
@ -59,10 +59,6 @@ func TestNPMPublish(t *testing.T) {
|
||||||
t.Fatalf("Can't unmarshal publish script: %s", err)
|
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") {
|
if !strings.Contains(bscr, "npm publish") {
|
||||||
t.Error("Expect script to contain install command")
|
t.Error("Expect script to contain install command")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue