Skip to content

Commit f8e1b8d

Browse files
authored
Merge pull request #909 from ocaml/fix-darcs
Filter installable system dependencies correctly
2 parents 2760130 + 24c7ef0 commit f8e1b8d

File tree

2 files changed

+18
-6
lines changed

2 files changed

+18
-6
lines changed

dist/index.js

Lines changed: 9 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/setup-ocaml/src/unix.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,22 @@ async function checkAptInstallability(packageName: string) {
99
"--names-only",
1010
`'^${packageName}$'`,
1111
]);
12-
return output.stdout.length !== 0;
12+
return output.stdout.length > 0;
1313
}
1414

1515
async function retrieveInstallableOptionalDependencies(
1616
optionalDependencies: string[],
1717
) {
1818
switch (PLATFORM) {
1919
case "linux": {
20-
return optionalDependencies.filter(
21-
async (dep) => await checkAptInstallability(dep),
22-
);
20+
const installableOptionalDependencies: string[] = [];
21+
for (const optionalDependency of optionalDependencies) {
22+
const isInstallable = await checkAptInstallability(optionalDependency);
23+
if (isInstallable) {
24+
installableOptionalDependencies.push(optionalDependency);
25+
}
26+
}
27+
return installableOptionalDependencies;
2328
}
2429
default: {
2530
return [];

0 commit comments

Comments
 (0)