export async function extractJbr()

in vscode/qodana/src/core/jdk/jbrDownloader.ts [60:77]


export async function extractJbr(filePath: string, releaseName: string, extractPath: string): Promise<string | undefined> {
    try {
        await tar.x({
            file: filePath,
            cwd: extractPath
        });
        let dirName = releaseName.replace('.tar.gz', '');
        let osType = getOsAndArch().osType;
        if (osType === 'osx') {
            return path.join(extractPath, dirName, 'Contents', 'Home', 'bin', 'java');
        }
        return path.join(extractPath, dirName, 'bin', 'java'  + (osType === 'windows' ? '.exe' : ''));
    } catch (e) {
        vscode.window.showErrorMessage(failedToExtractJbr(filePath) + `: ${e}`);
        telemetry.errorReceived('#extractJbr exception');
    }
    return undefined;
}