since platform is exported immediately, bypass 'undefined' state
This commit is contained in:
parent
d4b89a9511
commit
e2951284d4
@ -21,8 +21,6 @@ export function toFancyPlatform (platform) {
|
||||
return platform;
|
||||
}
|
||||
|
||||
let isAlpine;
|
||||
|
||||
function detectAlpine () {
|
||||
const { platform } = process;
|
||||
if (platform !== 'linux') return false;
|
||||
@ -31,9 +29,10 @@ function detectAlpine () {
|
||||
return /\bmusl\b/.test(ldd);
|
||||
}
|
||||
|
||||
const isAlpine = detectAlpine();
|
||||
|
||||
function getHostPlatform () {
|
||||
const { platform } = process;
|
||||
if (isAlpine === undefined) isAlpine = detectAlpine();
|
||||
if (isAlpine) return 'alpine';
|
||||
return toFancyPlatform(platform);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user