From ab056682678739b96412ce0b44d297f44c1fd5b3 Mon Sep 17 00:00:00 2001 From: Andy Trevorah Date: Mon, 14 Jan 2019 16:15:53 +0000 Subject: [PATCH] fix plugin trashing existing .npmrc The fix is to append the contents of ~/.npmrc to the local /npmrc rather than overwrite it. Also, this fixes an issue where only the first line would be appended (`always-auth` etc was getting lost). This was caused by echo only printing to the first carriage return. I've also stopped replacing whitespace with newlines as it seems error prone. --- bin/npm-auth | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/npm-auth b/bin/npm-auth index e63ca90..87a5247 100755 --- a/bin/npm-auth +++ b/bin/npm-auth @@ -47,6 +47,6 @@ if [ ! -e ~/.npmrc ]; then echo "-- Error logging into NPM" exit 1 else - echo $(cat ~/.npmrc) | sed 's/[[:blank:]]\+/\n/g' > $path.npmrc + cat ~/.npmrc >> $path.npmrc echo "-- NPM authentication done!" fi \ No newline at end of file