From 25f1e24ce09b59de83e173a232a7841d8c704a68 Mon Sep 17 00:00:00 2001 From: Ke Zhu Date: Thu, 22 Jan 2015 20:36:19 -0500 Subject: [PATCH] publish npm package if not exist on registry #799 --- plugin/publish/npm/npm.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/publish/npm/npm.go b/plugin/publish/npm/npm.go index c51982c1..f300ec7c 100644 --- a/plugin/publish/npm/npm.go +++ b/plugin/publish/npm/npm.go @@ -22,7 +22,7 @@ EOF const CmdPublish = ` _NPM_PACKAGE_NAME=$(cd %s && npm list | head -n 1 | cut -d ' ' -f1) _NPM_PACKAGE_TAG="%s" -if [ -z "$(npm info ${_NPM_PACKAGE_NAME})" ] +if [ -z "$(npm info ${_NPM_PACKAGE_NAME} 2> /dev/null)" ] then npm publish %s [ -n ${_NPM_PACKAGE_TAG} ] && npm tag ${_NPM_PACKAGE_NAME} ${_NPM_PACKAGE_TAG}