mirror of
				https://github.com/threeal/cmake-action.git
				synced 2025-11-03 21:33:42 +00:00 
			
		
		
		
	feat: log command based on spawned process arguments
Signed-off-by: Alfi Maulana <alfi.maulana.f@gmail.com>
This commit is contained in:
		
							parent
							
								
									7ad4029dc8
								
							
						
					
					
						commit
						c4a442b85f
					
				
							
								
								
									
										2
									
								
								dist/action.mjs
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								dist/action.mjs
									
									
									
										generated
									
									
										vendored
									
									
								
							@ -72,10 +72,10 @@ function logCommand(command, ...args) {
 | 
			
		||||
 */
 | 
			
		||||
async function exec(command, args) {
 | 
			
		||||
    return new Promise((resolve, reject) => {
 | 
			
		||||
        logCommand(command, ...args);
 | 
			
		||||
        const proc = spawn(command, args, {
 | 
			
		||||
            stdio: ["ignore", "inherit", "inherit"],
 | 
			
		||||
        });
 | 
			
		||||
        logCommand(proc.spawnfile, ...proc.spawnargs.splice(1));
 | 
			
		||||
        proc.on("error", reject);
 | 
			
		||||
        proc.on("close", (code) => {
 | 
			
		||||
            if (code === 0) {
 | 
			
		||||
 | 
			
		||||
@ -12,10 +12,10 @@ import { spawn } from "node:child_process";
 | 
			
		||||
 */
 | 
			
		||||
export async function exec(command: string, args: string[]): Promise<void> {
 | 
			
		||||
  return new Promise<void>((resolve, reject) => {
 | 
			
		||||
    logCommand(command, ...args);
 | 
			
		||||
    const proc = spawn(command, args, {
 | 
			
		||||
      stdio: ["ignore", "inherit", "inherit"],
 | 
			
		||||
    });
 | 
			
		||||
    logCommand(proc.spawnfile, ...proc.spawnargs.splice(1));
 | 
			
		||||
    proc.on("error", reject);
 | 
			
		||||
    proc.on("close", (code) => {
 | 
			
		||||
      if (code === 0) {
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user