mirror of
				https://github.com/actions/setup-node.git
				synced 2025-11-04 01:03:33 +00:00 
			
		
		
		
	add check for stderr
This commit is contained in:
		
							parent
							
								
									fe0d1625a2
								
							
						
					
					
						commit
						71715969b1
					
				
							
								
								
									
										27929
									
								
								dist/cache-save/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										27929
									
								
								dist/cache-save/index.js
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										27823
									
								
								dist/setup/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										27823
									
								
								dist/setup/index.js
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@ -30,9 +30,16 @@ export const supportedPackageManagers: SupportedPackageManagers = {
 | 
				
			|||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export const getCommandOutput = async (toolCommand: string) => {
 | 
					export const getCommandOutput = async (toolCommand: string) => {
 | 
				
			||||||
  const {stdout, stderr, exitCode} = await exec.getExecOutput(toolCommand);
 | 
					  let {stdout, stderr, exitCode} = await exec.getExecOutput(
 | 
				
			||||||
 | 
					    toolCommand,
 | 
				
			||||||
 | 
					    undefined,
 | 
				
			||||||
 | 
					    {ignoreReturnCode: true}
 | 
				
			||||||
 | 
					  );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if (exitCode && stderr) {
 | 
					  if (exitCode) {
 | 
				
			||||||
 | 
					    stderr = !stderr
 | 
				
			||||||
 | 
					      ? `The '${toolCommand}' command failed with exit code: ${exitCode}`
 | 
				
			||||||
 | 
					      : stderr;
 | 
				
			||||||
    throw new Error(stderr);
 | 
					    throw new Error(stderr);
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user