@officebeats/matrix-iptv-cli 3.1.0 → 3.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/cli.js +24 -0
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -59,6 +59,19 @@ async function performUpdate() {
|
|
|
59
59
|
|
|
60
60
|
if (os.platform() !== "win32") {
|
|
61
61
|
fs.chmodSync(tempPath, "755");
|
|
62
|
+
|
|
63
|
+
// On macOS, remove quarantine flag to prevent Gatekeeper blocking
|
|
64
|
+
if (os.platform() === "darwin") {
|
|
65
|
+
try {
|
|
66
|
+
const { execSync } = require("child_process");
|
|
67
|
+
execSync(
|
|
68
|
+
`xattr -d com.apple.quarantine "${tempPath}" 2>/dev/null || true`
|
|
69
|
+
);
|
|
70
|
+
console.log(`[+] macOS quarantine flag cleared.`);
|
|
71
|
+
} catch (e) {
|
|
72
|
+
// xattr might fail silently, that's okay
|
|
73
|
+
}
|
|
74
|
+
}
|
|
62
75
|
}
|
|
63
76
|
|
|
64
77
|
// Replace old binary
|
|
@@ -73,11 +86,22 @@ async function performUpdate() {
|
|
|
73
86
|
break;
|
|
74
87
|
} catch (e) {
|
|
75
88
|
attempts++;
|
|
89
|
+
console.log(`[!] Retry ${attempts}/5: ${e.message}`);
|
|
76
90
|
if (attempts === 5) throw e;
|
|
77
91
|
await new Promise((r) => setTimeout(r, 500));
|
|
78
92
|
}
|
|
79
93
|
}
|
|
80
94
|
|
|
95
|
+
// Also clear quarantine on final binary path
|
|
96
|
+
if (os.platform() === "darwin") {
|
|
97
|
+
try {
|
|
98
|
+
const { execSync } = require("child_process");
|
|
99
|
+
execSync(
|
|
100
|
+
`xattr -d com.apple.quarantine "${binaryPath}" 2>/dev/null || true`
|
|
101
|
+
);
|
|
102
|
+
} catch (e) {}
|
|
103
|
+
}
|
|
104
|
+
|
|
81
105
|
console.log(`[+] Update complete. Rebooting system...\n`);
|
|
82
106
|
} catch (err) {
|
|
83
107
|
if (fs.existsSync(tempPath)) fs.unlinkSync(tempPath);
|