Created
July 2, 2024 12:04
-
-
Save ashemedai/a5a79985efe5c8c0ce51af9dd4894998 to your computer and use it in GitHub Desktop.
ruff fetch and install script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| if [ -z ${1} ]; then | |
| echo "Enter ruff release number" | |
| read VERSION | |
| else | |
| VERSION=${1} | |
| fi | |
| # https://github.com/astral-sh/ruff/releases/download/0.5.0/ruff-x86_64-unknown-linux-gnu.tar.gz | |
| ARCHIVE="ruff-x86_64-unknown-linux-gnu.tar.gz" | |
| URL="https://github.com/astral-sh/ruff/releases/download/${VERSION}/${ARCHIVE}" | |
| INSTALL_HOME="${HOME}/.local/bin" | |
| fetch () { | |
| echo "Fetching archive from '${URL}'" | |
| curl -sSLO "${URL}" | |
| } | |
| extract () { | |
| rm -rf "${INSTALL_HOME}/go" | |
| tar -x -f "${ARCHIVE}" -C "${INSTALL_HOME}" -v -z | |
| } | |
| if [ -f "${ARCHIVE}" ]; then | |
| extract | |
| else | |
| fetch | |
| extract | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment