From ae3937cacb6b13c4acd43b99140b6432317e3b1b Mon Sep 17 00:00:00 2001 From: Danny McCormick Date: Tue, 6 Aug 2019 16:39:01 -0400 Subject: [PATCH] Update authutil.js --- lib/authutil.js | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/lib/authutil.js b/lib/authutil.js index d428b4e4..b9fe8cb8 100644 --- a/lib/authutil.js +++ b/lib/authutil.js @@ -30,15 +30,7 @@ function writeRegistryToFile(registryUrl, fileLocation) { } core.debug(`Setting auth in ${fileLocation}`); let newContents = ''; - if (fs.existsSync(fileLocation)) { - const curContents = fs.readFileSync(fileLocation, 'utf8'); - curContents.split(os.EOL).forEach((line) => { - // Add current contents unless they are setting the registry - if (!line.toLowerCase().startsWith('registry')) { - newContents += line + os.EOL; - } - }); - } + // Remove http: or https: from front of registry. const authString = registryUrl.replace(/(^\w+:|^)/, '') + ':_authToken=${NODE_AUTH_TOKEN}'; const registryString = scope