mirror of
https://gitea.com/actions/setup-node.git
synced 2024-11-21 17:49:33 +01:00
Add dist
This commit is contained in:
parent
e77eaaccd3
commit
069a4f8926
1 changed files with 3 additions and 5 deletions
8
dist/setup/index.js
vendored
8
dist/setup/index.js
vendored
|
@ -72945,7 +72945,7 @@ function writeRegistryToFile(registryUrl, fileLocation, alwaysAuth) {
|
|||
scope = '@' + scope;
|
||||
}
|
||||
if (scope) {
|
||||
scope = scope.toLowerCase();
|
||||
scope = scope.toLowerCase() + ':';
|
||||
}
|
||||
core.debug(`Setting auth in ${fileLocation}`);
|
||||
let newContents = '';
|
||||
|
@ -72953,16 +72953,14 @@ function writeRegistryToFile(registryUrl, fileLocation, alwaysAuth) {
|
|||
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')) {
|
||||
if (!line.toLowerCase().startsWith(`${scope}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
|
||||
? `${scope}:registry=${registryUrl}`
|
||||
: `registry=${registryUrl}`;
|
||||
const registryString = `${scope}registry=${registryUrl}`;
|
||||
const alwaysAuthString = `always-auth=${alwaysAuth}`;
|
||||
newContents += `${authString}${os.EOL}${registryString}${os.EOL}${alwaysAuthString}`;
|
||||
fs.writeFileSync(fileLocation, newContents);
|
||||
|
|
Loading…
Reference in a new issue