mirror of
https://code.forgejo.org/actions/setup-node.git
synced 2024-11-05 19:45:48 +00: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;
|
scope = '@' + scope;
|
||||||
}
|
}
|
||||||
if (scope) {
|
if (scope) {
|
||||||
scope = scope.toLowerCase();
|
scope = scope.toLowerCase() + ':';
|
||||||
}
|
}
|
||||||
core.debug(`Setting auth in ${fileLocation}`);
|
core.debug(`Setting auth in ${fileLocation}`);
|
||||||
let newContents = '';
|
let newContents = '';
|
||||||
|
@ -72953,16 +72953,14 @@ function writeRegistryToFile(registryUrl, fileLocation, alwaysAuth) {
|
||||||
const curContents = fs.readFileSync(fileLocation, 'utf8');
|
const curContents = fs.readFileSync(fileLocation, 'utf8');
|
||||||
curContents.split(os.EOL).forEach((line) => {
|
curContents.split(os.EOL).forEach((line) => {
|
||||||
// Add current contents unless they are setting the registry
|
// Add current contents unless they are setting the registry
|
||||||
if (!line.toLowerCase().startsWith('registry')) {
|
if (!line.toLowerCase().startsWith(`${scope}registry`)) {
|
||||||
newContents += line + os.EOL;
|
newContents += line + os.EOL;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// Remove http: or https: from front of registry.
|
// Remove http: or https: from front of registry.
|
||||||
const authString = registryUrl.replace(/(^\w+:|^)/, '') + ':_authToken=${NODE_AUTH_TOKEN}';
|
const authString = registryUrl.replace(/(^\w+:|^)/, '') + ':_authToken=${NODE_AUTH_TOKEN}';
|
||||||
const registryString = scope
|
const registryString = `${scope}registry=${registryUrl}`;
|
||||||
? `${scope}:registry=${registryUrl}`
|
|
||||||
: `registry=${registryUrl}`;
|
|
||||||
const alwaysAuthString = `always-auth=${alwaysAuth}`;
|
const alwaysAuthString = `always-auth=${alwaysAuth}`;
|
||||||
newContents += `${authString}${os.EOL}${registryString}${os.EOL}${alwaysAuthString}`;
|
newContents += `${authString}${os.EOL}${registryString}${os.EOL}${alwaysAuthString}`;
|
||||||
fs.writeFileSync(fileLocation, newContents);
|
fs.writeFileSync(fileLocation, newContents);
|
||||||
|
|
Loading…
Reference in a new issue