[no ci] Add logging to launchSSD function

Enhanced the launchSSD function to include logging for stdout and stderr, directing output to specified log files.
This commit is contained in:
Jay Lee
2026-04-26 08:08:37 -04:00
committed by GitHub
parent dfb1dd860f
commit 1ee31b15b2

View File

@@ -75,13 +75,33 @@ async function takeScreenshot(filename) {
}
}
}
// Fire and forget application launcher
// Fire and forget application launcher with logging
function launchSSD() {
const workspace = process.env.GITHUB_WORKSPACE || process.cwd();
const outLogPath = path.join(workspace, 'ssd_out.log');
const errLogPath = path.join(workspace, 'ssd_err.log');
// Open file descriptors for logging
const out = fs.openSync(outLogPath, 'a');
const err = fs.openSync(errLogPath, 'a');
console.log(`Launching SSD... Logging stdout to ${outLogPath} and stderr to ${errLogPath}`);
const child = spawn('C:\\Program Files\\Certum\\SimplySign Desktop\\SimplySignDesktop.exe', [], {
detached: true,
stdio: 'ignore'
detached: true,
// stdio array: [stdin, stdout, stderr]
// We ignore stdin, and pipe stdout/stderr to our files
stdio: ['ignore', out, err]
});
child.unref();
// Catch immediate errors (e.g., file not found, permission denied)
child.on('error', (error) => {
console.error('Failed to spawn SimplySign Desktop:', error.message);
});
// Unreference the child so the parent script can exit
child.unref();
}
async function runSSD() {