@ -4840,11 +4840,23 @@ const github = __importStar(__webpack_require__(469));
const xmlbuilder = _ _importStar ( _ _webpack _require _ _ ( 312 ) ) ;
const xmlParser = _ _importStar ( _ _webpack _require _ _ ( 989 ) ) ;
function configAuthentication ( feedUrl , existingFileLocation = '' , processRoot = process . cwd ( ) ) {
const existingNuGetConfig = path . resolve ( processRoot , existingFileLocation == '' ? 'nuget.config' : existingFileLocation ) ;
const existingNuGetConfig = path . resolve ( processRoot , existingFileLocation === ''
? getExistingNugetConfig ( processRoot )
: existingFileLocation ) ;
const tempNuGetConfig = path . resolve ( processRoot , '../' , 'nuget.config' ) ;
writeFeedToFile ( feedUrl , existingNuGetConfig , tempNuGetConfig ) ;
}
exports . configAuthentication = configAuthentication ;
function getExistingNugetConfig ( processRoot ) {
const defaultConfigName = 'nuget.config' ;
const configFileNames = fs
. readdirSync ( processRoot )
. filter ( filename => filename . toLowerCase ( ) === defaultConfigName ) ;
if ( configFileNames . length ) {
return configFileNames [ 0 ] ;
}
return defaultConfigName ;
}
function writeFeedToFile ( feedUrl , existingFileLocation , tempFileLocation ) {
console . log ( ` dotnet-auth: Finding any source references in ${ existingFileLocation } , writing a new temporary configuration file with credentials to ${ tempFileLocation } ` ) ;
let xml ;
@ -16870,14 +16882,17 @@ class DotNetVersionInfo {
this . isExactVersionSet = true ;
return ;
}
let parts = version . split ( '.' ) ;
//Note: No support for previews when using generic
const parts = version . split ( '.' ) ;
if ( parts . length < 2 || parts . length > 3 )
this . throwInvalidVersionFormat ( ) ;
if ( parts . length == 3 && parts [ 2 ] !== 'x' && parts [ 2 ] !== '*' ) {
this . throwInvalidVersionFormat ( ) ;
}
let major = this . getVersionNumberOrThrow ( parts [ 0 ] ) ;
let minor = this . getVersionNumberOrThrow ( parts [ 1 ] ) ;
const major = this . getVersionNumberOrThrow ( parts [ 0 ] ) ;
const minor = [ 'x' , '*' ] . includes ( parts [ 1 ] )
? parts [ 1 ]
: this . getVersionNumberOrThrow ( parts [ 1 ] ) ;
this . fullversion = major + '.' + minor ;
}
getVersionNumberOrThrow ( input ) {
@ -16895,7 +16910,7 @@ class DotNetVersionInfo {
}
}
throwInvalidVersionFormat ( ) {
throw 'Invalid version format! Supported: 1.2.3, 1.2, 1.2.x, 1.2.*' ;
throw new Error ( 'Invalid version format! Supported: 1.2.3, 1.2, 1.2.x, 1.2.*' ) ;
}
/ * *
* If true exacatly one version should be resolved
@ -16999,7 +17014,7 @@ class DotnetCoreInstaller {
}
console . log ( process . env [ 'PATH' ] ) ;
if ( resultCode != 0 ) {
throw ` Failed to install dotnet ${ resultCode } . ${ output } ` ;
throw new Error ( ` Failed to install dotnet ${ resultCode } . ${ output } ` ) ;
}
} ) ;
}
@ -17035,7 +17050,7 @@ class DotnetCoreInstaller {
includePrerelease : this . includePrerelease
} ) ) ;
if ( releasesInfo . length == 0 ) {
throw ` Could not find dotnet core version. Please ensure that specified version ${ versionInfo . inputVersion } is valid. ` ;
throw new Error ( ` Could not find dotnet core version. Please ensure that specified version ${ versionInfo . inputVersion } is valid. ` ) ;
}
let release = releasesInfo [ 0 ] ;
return release [ 'sdk' ] [ 'version' ] ;
@ -17056,7 +17071,7 @@ class DotnetCoreInstaller {
return versionParts [ 0 ] == sdkParts [ 0 ] ;
} ) ;
if ( releasesInfo . length === 0 ) {
throw ` Could not find info for version ${ versionParts . join ( '.' ) } at ${ DotNetCoreIndexUrl } ` ;
throw new Error ( ` Could not find info for version ${ versionParts . join ( '.' ) } at ${ DotNetCoreIndexUrl } ` ) ;
}
return releasesInfo [ 0 ] [ 'releases.json' ] ;
} ) ;