mirror of
https://github.com/ivabus/gui
synced 2025-04-23 14:07:14 +03:00
reconfigure bundle tea binary (#514)
Co-authored-by: neil molina <neil@neils-MacBook-Pro.local>
This commit is contained in:
parent
c4659fc91e
commit
8e443f1a66
1 changed files with 11 additions and 5 deletions
|
@ -31,12 +31,18 @@ export async function initializeTeaCli(): Promise<string> {
|
|||
const exists = fs.existsSync(cliBinPath);
|
||||
if (exists) {
|
||||
log.info("binary tea already exists at", cliBinPath);
|
||||
binCheck = await asyncExec(`cd ${destinationDirectory} && ./tea --version`);
|
||||
const teaVersion = binCheck.toString().split(" ")[1];
|
||||
|
||||
if (semverCompare(teaVersion, MINIMUM_TEA_VERSION) < 0) {
|
||||
log.info("binary tea version is too old, updating");
|
||||
try {
|
||||
binCheck = await asyncExec(`cd ${destinationDirectory} && ./tea --version`);
|
||||
const teaVersion = binCheck.toString().split(" ")[1];
|
||||
if (semverCompare(teaVersion, MINIMUM_TEA_VERSION) < 0) {
|
||||
log.info("binary tea version is too old, updating");
|
||||
needsUpdate = true;
|
||||
}
|
||||
} catch (error) {
|
||||
// probably binary is not executable or no permission
|
||||
log.error("Error checking tea binary version:", error);
|
||||
needsUpdate = true;
|
||||
await asyncExec(`cd ${destinationDirectory} && rm tea`);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue