Skip to content

Commit

Permalink
append .exe
Browse files Browse the repository at this point in the history
  • Loading branch information
fheinecke committed Dec 19, 2024
1 parent e6c2bfb commit b3c5918
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tools/env-loader/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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!"
Expand Down

0 comments on commit b3c5918

Please sign in to comment.