From 7ee2c111fb807bf37d2747c8bb757f97220952a5 Mon Sep 17 00:00:00 2001 From: Kevin Stillhammer Date: Thu, 19 Sep 2024 14:57:21 +0200 Subject: [PATCH] Throw is RUNNER_TEMP is not set --- dist/save-cache/index.js | 15 +++++++++------ dist/setup/index.js | 15 +++++++++------ src/utils/inputs.ts | 21 +++++++++++++++------ 3 files changed, 33 insertions(+), 18 deletions(-) diff --git a/dist/save-cache/index.js b/dist/save-cache/index.js index 4d0d5f9..6f96493 100644 --- a/dist/save-cache/index.js +++ b/dist/save-cache/index.js @@ -83026,7 +83026,10 @@ function getToolBinDir() { return toolBinDirInput; } if (process.platform === "win32") { - return "D:\\a\\_temp\\uv-tool-bin-dir"; + if (process.env.RUNNER_TEMP !== undefined) { + return `${process.env.RUNNER_TEMP}${path_1.default.sep}uv-tool-bin-dir`; + } + throw Error("Could not determine UV_TOOL_BIN_DIR. Please make sure RUNNER_TEMP is set or provide the tool-bin-dir input"); } return undefined; } @@ -83036,7 +83039,10 @@ function getToolDir() { return toolDirInput; } if (process.platform === "win32") { - return "D:\\a\\_temp\\uv-tool-dir"; + if (process.env.RUNNER_TEMP !== undefined) { + return `${process.env.RUNNER_TEMP}${path_1.default.sep}uv-tool-dir`; + } + throw Error("Could not determine UV_TOOL_DIR. Please make sure RUNNER_TEMP is set or provide the tool-dir input"); } return undefined; } @@ -83048,10 +83054,7 @@ function getCacheLocalPath() { if (process.env.RUNNER_TEMP !== undefined) { return `${process.env.RUNNER_TEMP}${path_1.default.sep}setup-uv-cache`; } - if (process.platform === "win32") { - return "D:\\a\\_temp\\setup-uv-cache"; - } - return "/tmp/setup-uv-cache"; + throw Error("Could not determine UV_CACHE_DIR. Please make sure RUNNER_TEMP is set or provide the cache-local-path input"); } diff --git a/dist/setup/index.js b/dist/setup/index.js index 5c4b549..d98d484 100644 --- a/dist/setup/index.js +++ b/dist/setup/index.js @@ -90183,7 +90183,10 @@ function getToolBinDir() { return toolBinDirInput; } if (process.platform === "win32") { - return "D:\\a\\_temp\\uv-tool-bin-dir"; + if (process.env.RUNNER_TEMP !== undefined) { + return `${process.env.RUNNER_TEMP}${path_1.default.sep}uv-tool-bin-dir`; + } + throw Error("Could not determine UV_TOOL_BIN_DIR. Please make sure RUNNER_TEMP is set or provide the tool-bin-dir input"); } return undefined; } @@ -90193,7 +90196,10 @@ function getToolDir() { return toolDirInput; } if (process.platform === "win32") { - return "D:\\a\\_temp\\uv-tool-dir"; + if (process.env.RUNNER_TEMP !== undefined) { + return `${process.env.RUNNER_TEMP}${path_1.default.sep}uv-tool-dir`; + } + throw Error("Could not determine UV_TOOL_DIR. Please make sure RUNNER_TEMP is set or provide the tool-dir input"); } return undefined; } @@ -90205,10 +90211,7 @@ function getCacheLocalPath() { if (process.env.RUNNER_TEMP !== undefined) { return `${process.env.RUNNER_TEMP}${path_1.default.sep}setup-uv-cache`; } - if (process.platform === "win32") { - return "D:\\a\\_temp\\setup-uv-cache"; - } - return "/tmp/setup-uv-cache"; + throw Error("Could not determine UV_CACHE_DIR. Please make sure RUNNER_TEMP is set or provide the cache-local-path input"); } diff --git a/src/utils/inputs.ts b/src/utils/inputs.ts index 7d45ee6..fb54953 100644 --- a/src/utils/inputs.ts +++ b/src/utils/inputs.ts @@ -17,7 +17,12 @@ function getToolBinDir(): string | undefined { return toolBinDirInput; } if (process.platform === "win32") { - return "D:\\a\\_temp\\uv-tool-bin-dir"; + if (process.env.RUNNER_TEMP !== undefined) { + return `${process.env.RUNNER_TEMP}${path.sep}uv-tool-bin-dir`; + } + throw Error( + "Could not determine UV_TOOL_BIN_DIR. Please make sure RUNNER_TEMP is set or provide the tool-bin-dir input", + ); } return undefined; } @@ -28,7 +33,12 @@ function getToolDir(): string | undefined { return toolDirInput; } if (process.platform === "win32") { - return "D:\\a\\_temp\\uv-tool-dir"; + if (process.env.RUNNER_TEMP !== undefined) { + return `${process.env.RUNNER_TEMP}${path.sep}uv-tool-dir`; + } + throw Error( + "Could not determine UV_TOOL_DIR. Please make sure RUNNER_TEMP is set or provide the tool-dir input", + ); } return undefined; } @@ -41,8 +51,7 @@ function getCacheLocalPath(): string { 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"; + throw Error( + "Could not determine UV_CACHE_DIR. Please make sure RUNNER_TEMP is set or provide the cache-local-path input", + ); }