Skip to content

Commit b974d1d

Browse files
committed
fix: setup postgres
1 parent 97e1802 commit b974d1d

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

packages/@postgrestools/postgrestools/bin/postgrestools

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,21 @@ const PLATFORMS = {
2121
};
2222

2323
function isMusl() {
24-
let stderr;
24+
let stdout;
2525
try {
26-
stderr = execSync("ldd --version", {
26+
stdout = execSync("ldd --version", {
2727
stdio: [
2828
"ignore", // stdin
2929
"pipe", // stdout – glibc systems print here
3030
"pipe", // stderr – musl systems print here
3131
],
3232
});
3333
} catch (err) {
34-
stderr = err.stderr;
34+
if (typeof err === "object" && err !== null && "stderr" in err) {
35+
stdout = err.stderr;
36+
}
3537
}
36-
if (stderr?.indexOf("musl") > -1) {
38+
if (typeof stdout === 'string' && stdout?.indexOf("musl") > -1) {
3739
return true;
3840
}
3941
return false;

0 commit comments

Comments
 (0)