Refactor execSync and spawn calls to include windowsHide option for better compatibility on Windows environments.

This commit is contained in:
decolua
2026-04-14 11:48:59 +07:00
parent 04cdb75839
commit 1fa05eb2ab
8 changed files with 45 additions and 34 deletions

View File

@@ -29,10 +29,10 @@ function checkCertInstalledMac(certPath) {
try {
const fingerprint = getCertFingerprint(certPath).replace(/:/g, "");
// security verify-cert returns 0 only if cert is trusted by system policy
exec(`security verify-cert -c "${certPath}" -p ssl -k /Library/Keychains/System.keychain 2>/dev/null`, (error) => {
exec(`security verify-cert -c "${certPath}" -p ssl -k /Library/Keychains/System.keychain 2>/dev/null`, { windowsHide: true }, (error) => {
if (!error) return resolve(true);
// Fallback: check if fingerprint appears in System keychain with trust
exec(`security dump-trust-settings -d 2>/dev/null | grep -i "${fingerprint}"`, (err2, stdout2) => {
exec(`security dump-trust-settings -d 2>/dev/null | grep -i "${fingerprint}"`, { windowsHide: true }, (err2, stdout2) => {
resolve(!err2 && !!stdout2?.trim());
});
});