Commit bdbff986 authored by Auto Backup's avatar Auto Backup

debug: add verbose debug logging for command execution

parent 04333d74
......@@ -158,11 +158,24 @@ async function executeCommand(command) {
// Windows: Wrap command with cmd /c to support .cmd and .bat files (like npm)
// pwsh cannot directly execute .cmd files
actualCommand = `cmd /c "${command}"`;
console.log(`🔍 [DEBUG] Executing command: ${actualCommand}`);
}
const result = await execWithShell(actualCommand, parentShell);
if (isWindows) {
console.log(`🔍 [DEBUG] stdout: "${result.stdout}"`);
console.log(`🔍 [DEBUG] stderr: "${result.stderr}"`);
}
return { success: true, stdout: result.stdout, stderr: result.stderr };
} catch (error) {
if (isWindows) {
console.log(`🔍 [DEBUG] Command failed: ${command}`);
console.log(`🔍 [DEBUG] Error message: ${error.message || error.error || 'unknown'}`);
console.log(`🔍 [DEBUG] stdout: "${error.stdout || ''}"`);
console.log(`🔍 [DEBUG] stderr: "${error.stderr || ''}"`);
}
return {
success: false,
stdout: error.stdout || '',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment