Skip to content

Instantly share code, notes, and snippets.

@ashemedai
Created July 2, 2024 12:04
Show Gist options
  • Select an option

  • Save ashemedai/a5a79985efe5c8c0ce51af9dd4894998 to your computer and use it in GitHub Desktop.

Select an option

Save ashemedai/a5a79985efe5c8c0ce51af9dd4894998 to your computer and use it in GitHub Desktop.
ruff fetch and install script
#!/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