Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
e-korolevskii committed Sep 30, 2022
1 parent 26db247 commit 942a0be
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 18 deletions.
13 changes: 5 additions & 8 deletions dist/index.js
Expand Up @@ -102,11 +102,14 @@ function writeFeedToFile(feedUrl, existingFileLocation, tempFileLocation) {
}
const xmlSource = [
{
'?xml version="1.0"': [
'?xml': [
{
'#text': ''
}
]
],
':@': {
'@_version': '1.0'
}
},
{
configuration: [
Expand Down Expand Up @@ -166,11 +169,6 @@ function writeFeedToFile(feedUrl, existingFileLocation, tempFileLocation) {
xmlSource[1].configuration.push({
packageSourceCredentials
});
// If NuGet fixes itself such that on Linux it can look for environment variables in the config file (it doesn't seem to work today),
// use this for the value above
// process.platform == 'win32'
// ? '%NUGET_AUTH_TOKEN%'
// : '$NUGET_AUTH_TOKEN'
const xmlBuilderOptions = {
format: true,
ignoreAttributes: false,
Expand All @@ -181,7 +179,6 @@ function writeFeedToFile(feedUrl, existingFileLocation, tempFileLocation) {
};
const builder = new fast_xml_parser_1.XMLBuilder(xmlBuilderOptions);
const output = builder.build(xmlSource).trim();
core.debug(output);
fs.writeFileSync(tempFileLocation, output);
}

Expand Down
15 changes: 5 additions & 10 deletions src/authutil.ts
Expand Up @@ -103,11 +103,14 @@ function writeFeedToFile(

const xmlSource: any[] = [
{
'?xml version="1.0"': [
'?xml': [
{
'#text': ''
}
]
],
':@': {
'@_version': '1.0'
}
},
{
configuration: [
Expand Down Expand Up @@ -176,12 +179,6 @@ function writeFeedToFile(
packageSourceCredentials
});

// If NuGet fixes itself such that on Linux it can look for environment variables in the config file (it doesn't seem to work today),
// use this for the value above
// process.platform == 'win32'
// ? '%NUGET_AUTH_TOKEN%'
// : '$NUGET_AUTH_TOKEN'

const xmlBuilderOptions = {
format: true,
ignoreAttributes: false,
Expand All @@ -195,7 +192,5 @@ function writeFeedToFile(

const output = builder.build(xmlSource).trim();

core.debug(output);

fs.writeFileSync(tempFileLocation, output);
}

0 comments on commit 942a0be

Please sign in to comment.