Chore: Upgrade Jenkins-job-builder to 6.3.0
[releng/global-jjb.git] / shell / npm-config.sh
index 749e7e5..06bf5d1 100644 (file)
@@ -39,14 +39,12 @@ do_config() {
     USER=$(echo "$CREDENTIAL" | cut -f1 -d:)
     PASS=$(echo "$CREDENTIAL" | cut -f2 -d:)
 
-    if [ -z "$USER" ]
-    then
+    if [ -z "$USER" ]; then
         echo "ERROR: No user provided"
         return 1
     fi
 
-    if [ -z "$PASS" ]
-    then
+    if [ -z "$PASS" ]; then
         echo "ERROR: No password provided"
         return 1
     fi
@@ -55,5 +53,5 @@ do_config() {
     auth_token=$(echo -n "$USER":"$PASS" | openssl base64)
 
     # Write .npmrc
-    echo '//'$NPM_REGISTRY':_auth'$auth_token >> $HOME/.npmrc
+    echo "//$NPM_REGISTRY:_auth$auth_token" >> "$HOME/.npmrc"
 }