Skip to content

Commit

Permalink
Use sudo to create install dir
Browse files Browse the repository at this point in the history
  • Loading branch information
fheinecke committed Dec 16, 2024
1 parent 559b553 commit a398325
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tools/env-loader/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,12 @@ runs:
# Install the tool
echo "Installing to ${INSTALL_DIR}..."
mkdir -pv "${INSTALL_DIR}"
tar -xzvf "${DOWNLOAD_PATH}" -C "${INSTALL_DIR}" "${TOOL_NAME}"
if ! command -v sudo; then
# Ensure the sudo "command" exists
alias sudo=""
fi
sudo mkdir -pv -m 755 "${INSTALL_DIR}"
sudo tar -xzvf "${DOWNLOAD_PATH}" -C "${INSTALL_DIR}" "${TOOL_NAME}"
echo "${INSTALL_DIR}" >> "${GITHUB_PATH}"
echo "Installation complete!"
Expand Down

0 comments on commit a398325

Please sign in to comment.