mirror of
https://github.com/actions/setup-node.git
synced 2026-03-16 07:25:46 +01:00
Ensure newline after registry string in authutil
Add a newline at the end of the registry string in authutil, to ensure that it's a proper POSIX file.
This commit is contained in:
parent
53b83947a5
commit
751e4076f7
2 changed files with 11 additions and 8 deletions
|
|
@ -44,6 +44,9 @@ function writeRegistryToFile(registryUrl: string, fileLocation: string) {
|
|||
registryUrl.replace(/(^\w+:|^)/, '') + ':_authToken=${NODE_AUTH_TOKEN}';
|
||||
const registryString = `${scope}registry=${registryUrl}`;
|
||||
newContents += `${authString}${os.EOL}${registryString}`;
|
||||
if (newContents && !newContents.endsWith(os.EOL)) {
|
||||
newContents += os.EOL;
|
||||
}
|
||||
fs.writeFileSync(fileLocation, newContents);
|
||||
core.exportVariable('NPM_CONFIG_USERCONFIG', fileLocation);
|
||||
// Export empty node_auth_token if didn't exist so npm doesn't complain about not being able to find it
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue