@apexacc/cli 1.2.3 → 1.2.4
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/apex +19 -0
- package/package.json +1 -1
package/bin/apex
CHANGED
|
@@ -90,6 +90,25 @@ async function ensureBinary() {
|
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
+
// Windows: download apex-verify
|
|
94
|
+
if (isWin) {
|
|
95
|
+
const verifyPath = join(os.homedir(), '.apex', 'apex-verify.exe')
|
|
96
|
+
const verifyVersionPath = join(os.homedir(), '.apex', '.verify-version')
|
|
97
|
+
let needsUpdate = !existsSync(verifyPath)
|
|
98
|
+
if (!needsUpdate) {
|
|
99
|
+
try {
|
|
100
|
+
const savedVersion = require('fs').readFileSync(verifyVersionPath, 'utf8').trim()
|
|
101
|
+
if (savedVersion !== VERSION) needsUpdate = true
|
|
102
|
+
} catch { needsUpdate = true }
|
|
103
|
+
}
|
|
104
|
+
if (needsUpdate) {
|
|
105
|
+
mkdirSync(join(os.homedir(), '.apex'), { recursive: true })
|
|
106
|
+
await download(`https://github.com/${REPO}/releases/download/v${VERSION}/apex-verify-windows.exe`, verifyPath)
|
|
107
|
+
await verifySha256(verifyPath, `https://github.com/${REPO}/releases/download/v${VERSION}/apex-verify-windows.exe.sha256`)
|
|
108
|
+
require('fs').writeFileSync(verifyVersionPath, VERSION)
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
93
112
|
// Mac: download apex-verify
|
|
94
113
|
if (process.platform === 'darwin') {
|
|
95
114
|
const verifyPath = join(os.homedir(), '.apex', 'apex-verify')
|