Skip to content

Commit 6b1537a

Browse files
committed
Cleanup
Signed-off-by: Sora Morimoto <sora@morimoto.io>
1 parent 7370deb commit 6b1537a

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

dist/index.js

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

packages/setup-ocaml/src/installer.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,9 @@ export async function installer() {
8888
core.exportVariable("DUNE_CACHE_TRANSPORT", "direct");
8989
}
9090
core.exportVariable("CLICOLOR_FORCE", "1");
91-
const fnames = await retrieveOpamLocalPackages();
92-
if (fnames.length > 0) {
93-
if (OPAM_PIN) {
94-
await pin(fnames);
95-
}
91+
if (OPAM_PIN) {
92+
const fnames = await retrieveOpamLocalPackages();
93+
await pin(fnames);
9694
}
9795
await exec("opam", ["--version"]);
9896
await exec("opam", ["exec", "--", "ocaml", "-version"]);

packages/setup-ocaml/src/opam.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,9 @@ export async function installOcaml(ocamlCompiler: string) {
137137
}
138138

139139
export async function pin(fpaths: string[]) {
140+
if (fpaths.length === 0) {
141+
return;
142+
}
140143
await core.group("Pin local packages", async () => {
141144
for (const fpath of fpaths) {
142145
const fname = path.basename(fpath, ".opam");

0 commit comments

Comments
 (0)