Skip to content

Commit 30f56e6

Browse files
committed
tc -> toolCache
Signed-off-by: Sora Morimoto <[email protected]>
1 parent 5141167 commit 30f56e6

File tree

2 files changed

+25
-21
lines changed

2 files changed

+25
-21
lines changed

dist/post/index.js

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

packages/setup-ocaml/src/opam.ts

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import * as core from "@actions/core";
77
import { exec, getExecOutput } from "@actions/exec";
88
import * as github from "@actions/github";
99
import * as io from "@actions/io";
10-
import * as tc from "@actions/tool-cache";
10+
import * as toolCache from "@actions/tool-cache";
1111
import * as semver from "semver";
1212

1313
import { saveCygwinCache } from "./cache.js";
@@ -76,11 +76,11 @@ async function findOpam() {
7676

7777
async function acquireOpamUnix() {
7878
const { version, browserDownloadUrl } = await getLatestOpamRelease();
79-
const cachedPath = tc.find("opam", version, ARCHITECTURE);
79+
const cachedPath = toolCache.find("opam", version, ARCHITECTURE);
8080
if (cachedPath === "") {
81-
const downloadedPath = await tc.downloadTool(browserDownloadUrl);
81+
const downloadedPath = await toolCache.downloadTool(browserDownloadUrl);
8282
core.info(`Acquired ${version} from ${browserDownloadUrl}`);
83-
const cachedPath = await tc.cacheFile(
83+
const cachedPath = await toolCache.cacheFile(
8484
downloadedPath,
8585
"opam",
8686
"opam",
@@ -161,12 +161,12 @@ async function setupOpamUnix() {
161161

162162
async function setupCygwin() {
163163
const version = await getCygwinVersion();
164-
const cachedPath = tc.find("cygwin", version, "x86_64");
164+
const cachedPath = toolCache.find("cygwin", version, "x86_64");
165165
if (cachedPath === "") {
166-
const downloadedPath = await tc.downloadTool(
166+
const downloadedPath = await toolCache.downloadTool(
167167
"https://cygwin.com/setup-x86_64.exe",
168168
);
169-
const cachedPath = await tc.cacheFile(
169+
const cachedPath = await toolCache.cacheFile(
170170
downloadedPath,
171171
"setup-x86_64.exe",
172172
"cygwin",
@@ -208,13 +208,17 @@ async function setupCygwin() {
208208

209209
async function acquireOpamWindows() {
210210
const opamVersion = "0.0.0.2";
211-
const cachedPath = tc.find("opam", opamVersion);
211+
const cachedPath = toolCache.find("opam", opamVersion);
212212
if (cachedPath === "") {
213-
const downloadedPath = await tc.downloadTool(
213+
const downloadedPath = await toolCache.downloadTool(
214214
`https://github.com/fdopen/opam-repository-mingw/releases/download/${opamVersion}/opam64.zip`,
215215
);
216-
const extractedPath = await tc.extractZip(downloadedPath);
217-
const cachedPath = await tc.cacheDir(extractedPath, "opam", opamVersion);
216+
const extractedPath = await toolCache.extractZip(downloadedPath);
217+
const cachedPath = await toolCache.cacheDir(
218+
extractedPath,
219+
"opam",
220+
opamVersion,
221+
);
218222
const installSh = path.join(cachedPath, "opam64", "install.sh");
219223
await fs.chmod(installSh, 0o755);
220224
await exec("bash", [installSh, "--prefix", "/usr"]);

0 commit comments

Comments
 (0)