From b3c591801f8c892ccff51f89789e1964994e6a4a Mon Sep 17 00:00:00 2001 From: Fred Heinecke Date: Thu, 19 Dec 2024 13:09:13 -0600 Subject: [PATCH] append .exe --- tools/env-loader/action.yaml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/env-loader/action.yaml b/tools/env-loader/action.yaml index 7f0a8ac..2c8ab4a 100644 --- a/tools/env-loader/action.yaml +++ b/tools/env-loader/action.yaml @@ -74,13 +74,20 @@ runs: echo "Installing to ${INSTALL_DIR}..." maybe_sudo mkdir -pv -m 755 "${INSTALL_DIR}" + + TOOL_FILE_NAME="${TOOL_NAME}" + if [[ "${RUNNER_OS}" == 'Windows' ]]; then + TOOL_FILE_NAME+='.exe' + fi + # The tar `-C` flag may not be used with an absolute path, because tar interprets # `:` in the path name as a network address. Windows uses this to separate # drive/partition letter from file path, so this does not work on Windows. The # easiest workaround is just `pushd`/`popd`. pushd "$(dirname "${DOWNLOAD_PATH}")" || (echo "failed to change to download path" >&2; exit 1) - maybe_sudo tar -xzf "$(basename "${DOWNLOAD_PATH}")" -C "${INSTALL_DIR}" "${TOOL_NAME}" + maybe_sudo tar -xzf "$(basename "${DOWNLOAD_PATH}")" -C "${INSTALL_DIR}" "${TOOL_FILE_NAME}" popd || (echo "failed to leave the download path" >&2; exit 1) + echo "${INSTALL_DIR}" >> "${GITHUB_PATH}" echo "Installation complete!"