mirror of
				https://github.com/actions/setup-node.git
				synced 2025-11-04 13:29:12 +08:00 
			
		
		
		
	Quote exec parameters
This commit is contained in:
		
							
								
								
									
										4
									
								
								dist/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								dist/index.js
									
									
									
									
										vendored
									
									
								
							@@ -15225,12 +15225,12 @@ function run() {
 | 
				
			|||||||
            }
 | 
					            }
 | 
				
			||||||
            // Output version of node and npm that are being used
 | 
					            // Output version of node and npm that are being used
 | 
				
			||||||
            const nodePath = yield io.which('node');
 | 
					            const nodePath = yield io.which('node');
 | 
				
			||||||
            const nodeVersion = child_process_1.default.execSync(`${nodePath} --version`);
 | 
					            const nodeVersion = child_process_1.default.execSync(`"${nodePath}" --version`);
 | 
				
			||||||
            console.log(`Node Version: ${nodeVersion}`);
 | 
					            console.log(`Node Version: ${nodeVersion}`);
 | 
				
			||||||
            const npmPath = yield io.which('npm');
 | 
					            const npmPath = yield io.which('npm');
 | 
				
			||||||
            // Older versions of Node don't include npm
 | 
					            // Older versions of Node don't include npm
 | 
				
			||||||
            if (npmPath) {
 | 
					            if (npmPath) {
 | 
				
			||||||
                const npmVersion = child_process_1.default.execSync(`${npmPath} --version`);
 | 
					                const npmVersion = child_process_1.default.execSync(`"${npmPath}" --version`);
 | 
				
			||||||
                console.log(`npm Version: ${npmVersion}`);
 | 
					                console.log(`npm Version: ${npmVersion}`);
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            const registryUrl = core.getInput('registry-url');
 | 
					            const registryUrl = core.getInput('registry-url');
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -21,13 +21,13 @@ async function run() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    // Output version of node and npm that are being used
 | 
					    // Output version of node and npm that are being used
 | 
				
			||||||
    const nodePath = await io.which('node');
 | 
					    const nodePath = await io.which('node');
 | 
				
			||||||
    const nodeVersion = cp.execSync(`${nodePath} --version`);
 | 
					    const nodeVersion = cp.execSync(`"${nodePath}" --version`);
 | 
				
			||||||
    console.log(`Node Version: ${nodeVersion}`);
 | 
					    console.log(`Node Version: ${nodeVersion}`);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    const npmPath = await io.which('npm');
 | 
					    const npmPath = await io.which('npm');
 | 
				
			||||||
    // Older versions of Node don't include npm
 | 
					    // Older versions of Node don't include npm
 | 
				
			||||||
    if (npmPath) {
 | 
					    if (npmPath) {
 | 
				
			||||||
      const npmVersion = cp.execSync(`${npmPath} --version`);
 | 
					      const npmVersion = cp.execSync(`"${npmPath}" --version`);
 | 
				
			||||||
      console.log(`npm Version: ${npmVersion}`);
 | 
					      console.log(`npm Version: ${npmVersion}`);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user