Skip to content

Commit 942a0be

Browse files
committed
format
1 parent 26db247 commit 942a0be

File tree

2 files changed

+10
-18
lines changed

2 files changed

+10
-18
lines changed

dist/index.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,14 @@ function writeFeedToFile(feedUrl, existingFileLocation, tempFileLocation) {
102102
}
103103
const xmlSource = [
104104
{
105-
'?xml version="1.0"': [
105+
'?xml': [
106106
{
107107
'#text': ''
108108
}
109-
]
109+
],
110+
':@': {
111+
'@_version': '1.0'
112+
}
110113
},
111114
{
112115
configuration: [
@@ -166,11 +169,6 @@ function writeFeedToFile(feedUrl, existingFileLocation, tempFileLocation) {
166169
xmlSource[1].configuration.push({
167170
packageSourceCredentials
168171
});
169-
// 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),
170-
// use this for the value above
171-
// process.platform == 'win32'
172-
// ? '%NUGET_AUTH_TOKEN%'
173-
// : '$NUGET_AUTH_TOKEN'
174172
const xmlBuilderOptions = {
175173
format: true,
176174
ignoreAttributes: false,
@@ -181,7 +179,6 @@ function writeFeedToFile(feedUrl, existingFileLocation, tempFileLocation) {
181179
};
182180
const builder = new fast_xml_parser_1.XMLBuilder(xmlBuilderOptions);
183181
const output = builder.build(xmlSource).trim();
184-
core.debug(output);
185182
fs.writeFileSync(tempFileLocation, output);
186183
}
187184

src/authutil.ts

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,14 @@ function writeFeedToFile(
103103

104104
const xmlSource: any[] = [
105105
{
106-
'?xml version="1.0"': [
106+
'?xml': [
107107
{
108108
'#text': ''
109109
}
110-
]
110+
],
111+
':@': {
112+
'@_version': '1.0'
113+
}
111114
},
112115
{
113116
configuration: [
@@ -176,12 +179,6 @@ function writeFeedToFile(
176179
packageSourceCredentials
177180
});
178181

179-
// 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),
180-
// use this for the value above
181-
// process.platform == 'win32'
182-
// ? '%NUGET_AUTH_TOKEN%'
183-
// : '$NUGET_AUTH_TOKEN'
184-
185182
const xmlBuilderOptions = {
186183
format: true,
187184
ignoreAttributes: false,
@@ -195,7 +192,5 @@ function writeFeedToFile(
195192

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

198-
core.debug(output);
199-
200195
fs.writeFileSync(tempFileLocation, output);
201196
}

0 commit comments

Comments
 (0)