@apexacc/cli 1.2.3 → 1.2.5
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 +22 -1
- package/package.json +1 -1
package/bin/apex
CHANGED
|
@@ -66,6 +66,27 @@ async function verifySha256(filePath, hashUrl) {
|
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
+
async function ensureVerify() {
|
|
70
|
+
// Windows: download apex-verify
|
|
71
|
+
if (isWin) {
|
|
72
|
+
const verifyPath = join(os.homedir(), '.apex', 'apex-verify.exe')
|
|
73
|
+
const verifyVersionPath = join(os.homedir(), '.apex', '.verify-version')
|
|
74
|
+
let needsUpdate = !existsSync(verifyPath)
|
|
75
|
+
if (!needsUpdate) {
|
|
76
|
+
try {
|
|
77
|
+
const savedVersion = require('fs').readFileSync(verifyVersionPath, 'utf8').trim()
|
|
78
|
+
if (savedVersion !== VERSION) needsUpdate = true
|
|
79
|
+
} catch { needsUpdate = true }
|
|
80
|
+
}
|
|
81
|
+
if (needsUpdate) {
|
|
82
|
+
mkdirSync(join(os.homedir(), '.apex'), { recursive: true })
|
|
83
|
+
await download(`https://github.com/${REPO}/releases/download/v${VERSION}/apex-verify-windows.exe`, verifyPath)
|
|
84
|
+
await verifySha256(verifyPath, `https://github.com/${REPO}/releases/download/v${VERSION}/apex-verify-windows.exe.sha256`)
|
|
85
|
+
require('fs').writeFileSync(verifyVersionPath, VERSION)
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
|
|
69
90
|
async function ensureBinary() {
|
|
70
91
|
if (existsSync(BIN_PATH)) return
|
|
71
92
|
console.log('Downloading Apex Copilot (~150MB), please wait...')
|
|
@@ -113,7 +134,7 @@ async function ensureBinary() {
|
|
|
113
134
|
console.log('Done!')
|
|
114
135
|
}
|
|
115
136
|
|
|
116
|
-
ensureBinary().then(() => {
|
|
137
|
+
ensureVerify().then(() => ensureBinary()).then(() => {
|
|
117
138
|
const result = spawnSync(BIN_PATH, process.argv.slice(2), {
|
|
118
139
|
stdio: 'inherit', env: process.env
|
|
119
140
|
})
|