From 942a0bea3963aeed4f8928d481f31006844b57e2 Mon Sep 17 00:00:00 2001 From: Evgenii Korolevskii Date: Fri, 30 Sep 2022 02:37:51 +0200 Subject: [PATCH] format --- dist/index.js | 13 +++++-------- src/authutil.ts | 15 +++++---------- 2 files changed, 10 insertions(+), 18 deletions(-) diff --git a/dist/index.js b/dist/index.js index 44f099a..99c96ab 100644 --- a/dist/index.js +++ b/dist/index.js @@ -102,11 +102,14 @@ function writeFeedToFile(feedUrl, existingFileLocation, tempFileLocation) { } const xmlSource = [ { - '?xml version="1.0"': [ + '?xml': [ { '#text': '' } - ] + ], + ':@': { + '@_version': '1.0' + } }, { configuration: [ @@ -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, @@ -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); } diff --git a/src/authutil.ts b/src/authutil.ts index cb40453..56b8023 100644 --- a/src/authutil.ts +++ b/src/authutil.ts @@ -103,11 +103,14 @@ function writeFeedToFile( const xmlSource: any[] = [ { - '?xml version="1.0"': [ + '?xml': [ { '#text': '' } - ] + ], + ':@': { + '@_version': '1.0' + } }, { configuration: [ @@ -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, @@ -195,7 +192,5 @@ function writeFeedToFile( const output = builder.build(xmlSource).trim(); - core.debug(output); - fs.writeFileSync(tempFileLocation, output); }