Skip to content

Commit 85e7d44

Browse files
committed
update
1 parent 1600d80 commit 85e7d44

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

src/extension.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,19 @@ async function tryUpdateBinaries(binFolder: File, localVer?: string, notConfirm?
448448
}
449449
};
450450

451+
const getAvailableBinariesVersions = async (): Promise<string[] | Error | undefined> => {
452+
try {
453+
const url = `https://api-github.em-ide.com/repos/github0null/eide-resource/contents/binaries/${platformType}`;
454+
const fList = await utility.readGithubRepoFolder(url);
455+
if (fList instanceof Error) throw fList;
456+
return fList.filter(f => f.name.startsWith('bin-'))
457+
.map(f => f.name.replace('bin-', '').replace('.7z', ''))
458+
.filter(vStr => utility.isVersionString(vStr));
459+
} catch (error) {
460+
return error;
461+
}
462+
};
463+
451464
let preinstallVersion: string | undefined;
452465

453466
// compare version if local version is available
@@ -466,22 +479,9 @@ async function tryUpdateBinaries(binFolder: File, localVer?: string, notConfirm?
466479
}
467480
}
468481

469-
const getAvailableBinariesVersions = async (): Promise<string[] | Error | undefined> => {
470-
try {
471-
const url = `https://api-github.em-ide.com/repos/github0null/eide-resource/contents/binaries/${platformType}`;
472-
const fList = await utility.readGithubRepoFolder(url);
473-
if (fList instanceof Error) throw fList;
474-
return fList.filter(f => f.name.startsWith('bin-'))
475-
.map(f => f.name.replace('bin-', '').replace('.7z', ''))
476-
.filter(vStr => utility.isVersionString(vStr));
477-
} catch (error) {
478-
return error;
479-
}
480-
};
481-
482482
// can not match version, get version list from repo
483483
// select the latest version for min version requirment
484-
if (localVer == undefined && preinstallVersion == undefined) {
484+
else {
485485
const vList = await getAvailableBinariesVersions();
486486
if (vList && Array.isArray(vList)) {
487487
const minMainVer: string = minReqVersion.split('.')[0];

0 commit comments

Comments
 (0)