Skip to content

Commit

Permalink
Undo formatting changes to devtools
Browse files Browse the repository at this point in the history
  • Loading branch information
charludo committed Jan 15, 2025
1 parent 829577c commit 280f4a6
Showing 1 changed file with 11 additions and 26 deletions.
37 changes: 11 additions & 26 deletions tools/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,13 @@ echo "Checking system requirements..." | print_info

# Parse command line arguments
while [ "$#" -gt 0 ]; do
case "$1" in
--clean)
CLEAN=1
shift 1
;;
--pre-commit)
PRE_COMMIT=1
shift 1
;;
--python)
PYTHON="$2"
shift 2
;;
--python=*)
PYTHON="${1#*=}"
shift 1
;;
*)
echo "Unknown option: $1" | print_error
exit 1
;;
esac
case "$1" in
--clean) CLEAN=1; shift 1;;
--pre-commit) PRE_COMMIT=1; shift 1;;
--python) PYTHON="$2"; shift 2;;
--python=*) PYTHON="${1#*=}"; shift 1;;
*) echo "Unknown option: $1" | print_error; exit 1;;
esac
done

if [[ -n "${PYTHON}" ]]; then
Expand All @@ -57,8 +42,8 @@ if [[ ! -x "$(command -v python3)" ]]; then
fi
# Get the python version (the format is "Python 3.X.Z")
python_version=$(${PYTHON} --version | cut -d" " -f2)
if [[ $(major "$python_version") -lt $(major "$required_python_version") ]] ||
[[ $(major "$python_version") -eq $(major "$required_python_version") ]] && [[ $(minor "$python_version") -lt $(minor "$required_python_version") ]]; then
if [[ $(major "$python_version") -lt $(major "$required_python_version") ]] || \
[[ $(major "$python_version") -eq $(major "$required_python_version") ]] && [[ $(minor "$python_version") -lt $(minor "$required_python_version") ]]; then
echo "python version ${required_python_version} is required, but version ${python_version} is installed. Please install a recent version manually and run this script again." | print_error
echo -e "If you installed higher python version manually which is not your default python3, please pass the alternative python interpreter (e.g. python3.11) to the script:\n" | print_info
echo -e "\t$(dirname "${BASH_SOURCE[0]}")/install.sh --python python3.11\n" | print_bold
Expand Down Expand Up @@ -97,7 +82,7 @@ fi
# Get the node version (the format is vXX.YY.ZZ)
node_version=$(node -v | cut -c2-)
# Check if required node version is installed
if [[ $(major "$node_version") -lt "$required_node_version" ]]; then
if [[ $(major "$node_version") -lt "$required_node_version" ]] ; then
echo "nodejs version ${required_node_version} or higher is required, but version ${node_version} is installed. Please install a supported version manually and run this script again." | print_error
exit 1
fi
Expand Down Expand Up @@ -170,7 +155,7 @@ echo "✔ Installed Python dependencies" | print_success
# Install pre-commit-hooks if --pre-commit option is given
if [[ -n "${PRE_COMMIT}" ]]; then
echo "Installing pre-commit hooks..." | print_info
# Install pre-commit hook for ruff
# Install pre-commit hooks
pre-commit install
echo "✔ Installed pre-commit hooks" | print_success
fi
Expand Down

0 comments on commit 280f4a6

Please sign in to comment.