mirror of
https://github.com/astral-sh/setup-uv.git
synced 2025-01-19 16:28:18 +08:00
Use D:\a\_tmp\setup-uv-cache as default cacheLocalPath on Windows (#57)
Fixes: #52
This commit is contained in:
parent
4beb0eca42
commit
417c97acee
@ -26,7 +26,7 @@ inputs:
|
|||||||
required: false
|
required: false
|
||||||
cache-local-path:
|
cache-local-path:
|
||||||
description: "Local path to store the cache."
|
description: "Local path to store the cache."
|
||||||
default: "/tmp/setup-uv-cache"
|
default: ""
|
||||||
outputs:
|
outputs:
|
||||||
uv-version:
|
uv-version:
|
||||||
description: "The installed uv version. Useful when using latest."
|
description: "The installed uv version. Useful when using latest."
|
||||||
|
BIN
dist/save-cache/index.js
generated
vendored
BIN
dist/save-cache/index.js
generated
vendored
Binary file not shown.
BIN
dist/setup/index.js
generated
vendored
BIN
dist/setup/index.js
generated
vendored
Binary file not shown.
@ -1,9 +1,24 @@
|
|||||||
import * as core from "@actions/core";
|
import * as core from "@actions/core";
|
||||||
|
import path from "path";
|
||||||
|
|
||||||
export const version = core.getInput("version");
|
export const version = core.getInput("version");
|
||||||
export const checkSum = core.getInput("checksum");
|
export const checkSum = core.getInput("checksum");
|
||||||
export const enableCache = core.getInput("enable-cache") === "true";
|
export const enableCache = core.getInput("enable-cache") === "true";
|
||||||
export const cacheSuffix = core.getInput("cache-suffix") || "";
|
export const cacheSuffix = core.getInput("cache-suffix") || "";
|
||||||
export const cacheLocalPath = core.getInput("cache-local-path");
|
export const cacheLocalPath = getCacheLocalPath();
|
||||||
export const githubToken = core.getInput("github-token");
|
export const githubToken = core.getInput("github-token");
|
||||||
export const cacheDependencyGlob = core.getInput("cache-dependency-glob");
|
export const cacheDependencyGlob = core.getInput("cache-dependency-glob");
|
||||||
|
|
||||||
|
function getCacheLocalPath(): string {
|
||||||
|
const cacheLocalPathInput = core.getInput("cache-local-path");
|
||||||
|
if (cacheLocalPathInput !== "") {
|
||||||
|
return cacheLocalPathInput;
|
||||||
|
}
|
||||||
|
if (process.env.RUNNER_TEMP !== undefined) {
|
||||||
|
return `${process.env.RUNNER_TEMP}${path.sep}setup-uv-cache`;
|
||||||
|
}
|
||||||
|
if (process.platform === "win32") {
|
||||||
|
return "D:\\a\\_temp\\setup-uv-cache";
|
||||||
|
}
|
||||||
|
return "/tmp/setup-uv-cache";
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user