mirror of
				https://gitea.com/actions/setup-node.git
				synced 2025-10-29 15:52:42 +08:00 
			
		
		
		
	Compare commits
	
		
			1 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					be4c7f772f | 
@@ -205,18 +205,18 @@ function acquireNodeFromFallbackLocation(version) {
 | 
				
			|||||||
            exeUrl = `https://nodejs.org/dist/v${version}/win-${os.arch()}/node.exe`;
 | 
					            exeUrl = `https://nodejs.org/dist/v${version}/win-${os.arch()}/node.exe`;
 | 
				
			||||||
            libUrl = `https://nodejs.org/dist/v${version}/win-${os.arch()}/node.lib`;
 | 
					            libUrl = `https://nodejs.org/dist/v${version}/win-${os.arch()}/node.lib`;
 | 
				
			||||||
            const exePath = yield tc.downloadTool(exeUrl);
 | 
					            const exePath = yield tc.downloadTool(exeUrl);
 | 
				
			||||||
            yield io.cp(exePath, path.join(tempDir, 'node.exe'));
 | 
					            yield io.mv(exePath, path.join(tempDir, 'node.exe'));
 | 
				
			||||||
            const libPath = yield tc.downloadTool(libUrl);
 | 
					            const libPath = yield tc.downloadTool(libUrl);
 | 
				
			||||||
            yield io.cp(libPath, path.join(tempDir, 'node.lib'));
 | 
					            yield io.mv(libPath, path.join(tempDir, 'node.lib'));
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        catch (err) {
 | 
					        catch (err) {
 | 
				
			||||||
            if (err instanceof tc.HTTPError && err.httpStatusCode == 404) {
 | 
					            if (err instanceof tc.HTTPError && err.httpStatusCode == 404) {
 | 
				
			||||||
                exeUrl = `https://nodejs.org/dist/v${version}/node.exe`;
 | 
					                exeUrl = `https://nodejs.org/dist/v${version}/node.exe`;
 | 
				
			||||||
                libUrl = `https://nodejs.org/dist/v${version}/node.lib`;
 | 
					                libUrl = `https://nodejs.org/dist/v${version}/node.lib`;
 | 
				
			||||||
                const exePath = yield tc.downloadTool(exeUrl);
 | 
					                const exePath = yield tc.downloadTool(exeUrl);
 | 
				
			||||||
                yield io.cp(exePath, path.join(tempDir, 'node.exe'));
 | 
					                yield io.mv(exePath, path.join(tempDir, 'node.exe'));
 | 
				
			||||||
                const libPath = yield tc.downloadTool(libUrl);
 | 
					                const libPath = yield tc.downloadTool(libUrl);
 | 
				
			||||||
                yield io.cp(libPath, path.join(tempDir, 'node.lib'));
 | 
					                yield io.mv(libPath, path.join(tempDir, 'node.lib'));
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            else {
 | 
					            else {
 | 
				
			||||||
                throw err;
 | 
					                throw err;
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										2
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										2
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							@@ -1,6 +1,6 @@
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
  "name": "setup-node",
 | 
					  "name": "setup-node",
 | 
				
			||||||
  "version": "1.0.4",
 | 
					  "version": "1.0.0",
 | 
				
			||||||
  "lockfileVersion": 1,
 | 
					  "lockfileVersion": 1,
 | 
				
			||||||
  "requires": true,
 | 
					  "requires": true,
 | 
				
			||||||
  "dependencies": {
 | 
					  "dependencies": {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,6 +1,6 @@
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
  "name": "setup-node",
 | 
					  "name": "setup-node",
 | 
				
			||||||
  "version": "1.0.4",
 | 
					  "version": "1.0.0",
 | 
				
			||||||
  "private": true,
 | 
					  "private": true,
 | 
				
			||||||
  "description": "setup node action",
 | 
					  "description": "setup node action",
 | 
				
			||||||
  "main": "lib/setup-node.js",
 | 
					  "main": "lib/setup-node.js",
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -214,18 +214,18 @@ async function acquireNodeFromFallbackLocation(
 | 
				
			|||||||
    libUrl = `https://nodejs.org/dist/v${version}/win-${os.arch()}/node.lib`;
 | 
					    libUrl = `https://nodejs.org/dist/v${version}/win-${os.arch()}/node.lib`;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    const exePath = await tc.downloadTool(exeUrl);
 | 
					    const exePath = await tc.downloadTool(exeUrl);
 | 
				
			||||||
    await io.cp(exePath, path.join(tempDir, 'node.exe'));
 | 
					    await io.mv(exePath, path.join(tempDir, 'node.exe'));
 | 
				
			||||||
    const libPath = await tc.downloadTool(libUrl);
 | 
					    const libPath = await tc.downloadTool(libUrl);
 | 
				
			||||||
    await io.cp(libPath, path.join(tempDir, 'node.lib'));
 | 
					    await io.mv(libPath, path.join(tempDir, 'node.lib'));
 | 
				
			||||||
  } catch (err) {
 | 
					  } catch (err) {
 | 
				
			||||||
    if (err instanceof tc.HTTPError && err.httpStatusCode == 404) {
 | 
					    if (err instanceof tc.HTTPError && err.httpStatusCode == 404) {
 | 
				
			||||||
      exeUrl = `https://nodejs.org/dist/v${version}/node.exe`;
 | 
					      exeUrl = `https://nodejs.org/dist/v${version}/node.exe`;
 | 
				
			||||||
      libUrl = `https://nodejs.org/dist/v${version}/node.lib`;
 | 
					      libUrl = `https://nodejs.org/dist/v${version}/node.lib`;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      const exePath = await tc.downloadTool(exeUrl);
 | 
					      const exePath = await tc.downloadTool(exeUrl);
 | 
				
			||||||
      await io.cp(exePath, path.join(tempDir, 'node.exe'));
 | 
					      await io.mv(exePath, path.join(tempDir, 'node.exe'));
 | 
				
			||||||
      const libPath = await tc.downloadTool(libUrl);
 | 
					      const libPath = await tc.downloadTool(libUrl);
 | 
				
			||||||
      await io.cp(libPath, path.join(tempDir, 'node.lib'));
 | 
					      await io.mv(libPath, path.join(tempDir, 'node.lib'));
 | 
				
			||||||
    } else {
 | 
					    } else {
 | 
				
			||||||
      throw err;
 | 
					      throw err;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user