mirror of
				https://github.com/actions/setup-node.git
				synced 2025-11-04 13:29:12 +08:00 
			
		
		
		
	add trim and silent true
This commit is contained in:
		
							
								
								
									
										4
									
								
								dist/setup/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								dist/setup/index.js
									
									
									
									
										vendored
									
									
								
							@@ -71847,8 +71847,8 @@ function run() {
 | 
			
		||||
            }
 | 
			
		||||
            // Output version of node is being used
 | 
			
		||||
            try {
 | 
			
		||||
                const { stdout: installedVersion } = yield exec.getExecOutput('node', ['--version'], { ignoreReturnCode: true, silent: false });
 | 
			
		||||
                core.setOutput('node-version', installedVersion);
 | 
			
		||||
                const { stdout: installedVersion } = yield exec.getExecOutput('node', ['--version'], { ignoreReturnCode: true, silent: true });
 | 
			
		||||
                core.setOutput('node-version', installedVersion.trim());
 | 
			
		||||
            }
 | 
			
		||||
            catch (err) {
 | 
			
		||||
                core.setOutput('node-version', '');
 | 
			
		||||
 
 | 
			
		||||
@@ -2,6 +2,7 @@ import * as core from '@actions/core';
 | 
			
		||||
import * as exec from '@actions/exec';
 | 
			
		||||
import * as installer from './installer';
 | 
			
		||||
import fs from 'fs';
 | 
			
		||||
import * as child_process from 'child_process';
 | 
			
		||||
import * as auth from './authutil';
 | 
			
		||||
import * as path from 'path';
 | 
			
		||||
import {restoreCache} from './cache-restore';
 | 
			
		||||
@@ -45,9 +46,9 @@ export async function run() {
 | 
			
		||||
      const {stdout: installedVersion} = await exec.getExecOutput(
 | 
			
		||||
        'node',
 | 
			
		||||
        ['--version'],
 | 
			
		||||
        {ignoreReturnCode: true, silent: false}
 | 
			
		||||
        {ignoreReturnCode: true, silent: true}
 | 
			
		||||
      );
 | 
			
		||||
      core.setOutput('node-version', installedVersion);
 | 
			
		||||
      core.setOutput('node-version', installedVersion.trim());
 | 
			
		||||
    } catch (err) {
 | 
			
		||||
      core.setOutput('node-version', '');
 | 
			
		||||
    }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user