mirror of
				https://github.com/actions/setup-node.git
				synced 2025-10-31 23:43:33 +00:00 
			
		
		
		
	prints
This commit is contained in:
		
							parent
							
								
									91a5e5da06
								
							
						
					
					
						commit
						7188cb1e62
					
				
							
								
								
									
										9
									
								
								dist/setup/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										9
									
								
								dist/setup/index.js
									
									
									
									
										vendored
									
									
								
							| @ -100184,7 +100184,9 @@ class BaseDistribution { | ||||
|     } | ||||
|     getNodejsMirrorURLInfo(version) { | ||||
|         const mirrorURL = this.nodeInfo.mirrorURL; | ||||
|         core.info('mirrorURL from getNodejsMirrorURLInfo ' + mirrorURL); | ||||
|         const osArch = this.translateArchToDistUrl(this.nodeInfo.arch); | ||||
|         core.info('osArch from translateArchToDistUrl ' + osArch); | ||||
|         version = semver_1.default.clean(version) || ''; | ||||
|         const fileName = this.osPlat == 'win32' | ||||
|             ? `node-v${version}-win-${osArch}` | ||||
| @ -100195,6 +100197,7 @@ class BaseDistribution { | ||||
|                 : `${fileName}.7z` | ||||
|             : `${fileName}.tar.gz`; | ||||
|         const url = `${mirrorURL}/v${version}/${urlFileName}`; | ||||
|         core.info('url from construct ' + url); | ||||
|         return { | ||||
|             downloadUrl: url, | ||||
|             resolvedVersion: version, | ||||
| @ -100528,6 +100531,7 @@ class OfficialBuilds extends base_distribution_1.default { | ||||
|                 try { | ||||
|                     core.info(`Attempting to download using mirror URL...`); | ||||
|                     downloadPath = yield this.downloadFromMirrorURL(); // Attempt to download from the mirror
 | ||||
|                     core.info('downloadPath from downloadFromMirrorURL() ' + downloadPath); | ||||
|                     if (downloadPath) { | ||||
|                         toolPath = downloadPath; | ||||
|                     } | ||||
| @ -100723,14 +100727,19 @@ class OfficialBuilds extends base_distribution_1.default { | ||||
|     downloadFromMirrorURL() { | ||||
|         return __awaiter(this, void 0, void 0, function* () { | ||||
|             const nodeJsVersions = yield this.getMirrorUrVersions(); | ||||
|             core.info('nodeJsVersions from getMirrorUrVersions ' + nodeJsVersions); | ||||
|             const versions = this.filterVersions(nodeJsVersions); | ||||
|             core.info('versions from filterVersions ' + versions); | ||||
|             const evaluatedVersion = this.evaluateVersions(versions); | ||||
|             core.info('evaluatedVersion from evaluatedVersions ' + evaluatedVersion); | ||||
|             if (!evaluatedVersion) { | ||||
|                 throw new Error(`Unable to find Node version '${this.nodeInfo.versionSpec}' for platform ${this.osPlat} and architecture ${this.nodeInfo.arch}.`); | ||||
|             } | ||||
|             const toolName = this.getNodejsMirrorURLInfo(evaluatedVersion); | ||||
|             core.info('toolName from getNodejsMirrorURLInfo ' + toolName); | ||||
|             try { | ||||
|                 const toolPath = yield this.downloadNodejs(toolName); | ||||
|                 core.info('toolPath from downloadNodejs ' + toolPath); | ||||
|                 return toolPath; | ||||
|             } | ||||
|             catch (error) { | ||||
|  | ||||
| @ -139,7 +139,11 @@ export default abstract class BaseDistribution { | ||||
| 
 | ||||
|   protected getNodejsMirrorURLInfo(version: string) { | ||||
|     const mirrorURL = this.nodeInfo.mirrorURL; | ||||
|     core.info('mirrorURL from getNodejsMirrorURLInfo '+mirrorURL); | ||||
|      | ||||
|     const osArch: string = this.translateArchToDistUrl(this.nodeInfo.arch); | ||||
|     core.info('osArch from translateArchToDistUrl '+osArch); | ||||
|      | ||||
|     version = semver.clean(version) || ''; | ||||
|     const fileName: string = | ||||
|       this.osPlat == 'win32' | ||||
| @ -153,6 +157,7 @@ export default abstract class BaseDistribution { | ||||
|         : `${fileName}.tar.gz`; | ||||
| 
 | ||||
|     const url = `${mirrorURL}/v${version}/${urlFileName}`; | ||||
|       core.info('url from construct '+url); | ||||
| 
 | ||||
|     return <INodeVersionInfo>{ | ||||
|       downloadUrl: url, | ||||
|  | ||||
| @ -21,6 +21,7 @@ export default class OfficialBuilds extends BaseDistribution { | ||||
|       try { | ||||
|         core.info(`Attempting to download using mirror URL...`); | ||||
|         downloadPath = await this.downloadFromMirrorURL(); // Attempt to download from the mirror
 | ||||
|         core.info('downloadPath from downloadFromMirrorURL() '+ downloadPath); | ||||
|         if (downloadPath) { | ||||
|           toolPath = downloadPath; | ||||
|         } | ||||
| @ -317,10 +318,16 @@ export default class OfficialBuilds extends BaseDistribution { | ||||
| 
 | ||||
|   protected async downloadFromMirrorURL() { | ||||
|     const nodeJsVersions = await this.getMirrorUrVersions(); | ||||
|     core.info('nodeJsVersions from getMirrorUrVersions '+nodeJsVersions); | ||||
|     const versions = this.filterVersions(nodeJsVersions); | ||||
|     core.info('versions from filterVersions '+versions); | ||||
| 
 | ||||
| 
 | ||||
|     const evaluatedVersion = this.evaluateVersions(versions); | ||||
| 
 | ||||
|     core.info('evaluatedVersion from evaluatedVersions '+evaluatedVersion); | ||||
| 
 | ||||
| 
 | ||||
|     if (!evaluatedVersion) { | ||||
|       throw new Error( | ||||
|         `Unable to find Node version '${this.nodeInfo.versionSpec}' for platform ${this.osPlat} and architecture ${this.nodeInfo.arch}.` | ||||
| @ -329,8 +336,13 @@ export default class OfficialBuilds extends BaseDistribution { | ||||
| 
 | ||||
|     const toolName = this.getNodejsMirrorURLInfo(evaluatedVersion); | ||||
| 
 | ||||
|     core.info('toolName from getNodejsMirrorURLInfo '+toolName); | ||||
| 
 | ||||
| 
 | ||||
|     try { | ||||
|       const toolPath = await this.downloadNodejs(toolName); | ||||
|       core.info('toolPath from downloadNodejs '+toolPath); | ||||
| 
 | ||||
|       return toolPath; | ||||
|     } catch (error) { | ||||
|       if (error instanceof tc.HTTPError && error.httpStatusCode === 404) { | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user