Extract common getBinaryDirectory function for PyPy and GraalPy

This commit is contained in:
Michael Simacek 2023-08-29 09:07:16 +02:00
parent fb2947352f
commit 08f6b9181b
5 changed files with 28 additions and 29 deletions

View file

@ -262,3 +262,12 @@ export function getVersionInputFromFile(versionFile: string): string[] {
return getVersionInputFromPlainFile(versionFile);
}
}
/**
* Get the directory containing interpreter binary from installation directory of PyPy or GraalPy
* - On Linux and macOS, the Python interpreter is in 'bin'.
* - On Windows, it is in the installation root.
*/
export function getBinaryDirectory(installDir: string) {
return IS_WINDOWS ? installDir : path.join(installDir, 'bin');
}