Skip to content

Commit f914042

Browse files
committed
Undo formatting changes to devtools
1 parent bef3b67 commit f914042

File tree

1 file changed

+11
-26
lines changed

1 file changed

+11
-26
lines changed

tools/install.sh

Lines changed: 11 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -13,28 +13,13 @@ echo "Checking system requirements..." | print_info
1313

1414
# Parse command line arguments
1515
while [ "$#" -gt 0 ]; do
16-
case "$1" in
17-
--clean)
18-
CLEAN=1
19-
shift 1
20-
;;
21-
--pre-commit)
22-
PRE_COMMIT=1
23-
shift 1
24-
;;
25-
--python)
26-
PYTHON="$2"
27-
shift 2
28-
;;
29-
--python=*)
30-
PYTHON="${1#*=}"
31-
shift 1
32-
;;
33-
*)
34-
echo "Unknown option: $1" | print_error
35-
exit 1
36-
;;
37-
esac
16+
case "$1" in
17+
--clean) CLEAN=1; shift 1;;
18+
--pre-commit) PRE_COMMIT=1; shift 1;;
19+
--python) PYTHON="$2"; shift 2;;
20+
--python=*) PYTHON="${1#*=}"; shift 1;;
21+
*) echo "Unknown option: $1" | print_error; exit 1;;
22+
esac
3823
done
3924

4025
if [[ -n "${PYTHON}" ]]; then
@@ -57,8 +42,8 @@ if [[ ! -x "$(command -v python3)" ]]; then
5742
fi
5843
# Get the python version (the format is "Python 3.X.Z")
5944
python_version=$(${PYTHON} --version | cut -d" " -f2)
60-
if [[ $(major "$python_version") -lt $(major "$required_python_version") ]] ||
61-
[[ $(major "$python_version") -eq $(major "$required_python_version") ]] && [[ $(minor "$python_version") -lt $(minor "$required_python_version") ]]; then
45+
if [[ $(major "$python_version") -lt $(major "$required_python_version") ]] || \
46+
[[ $(major "$python_version") -eq $(major "$required_python_version") ]] && [[ $(minor "$python_version") -lt $(minor "$required_python_version") ]]; then
6247
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
6348
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
6449
echo -e "\t$(dirname "${BASH_SOURCE[0]}")/install.sh --python python3.11\n" | print_bold
@@ -97,7 +82,7 @@ fi
9782
# Get the node version (the format is vXX.YY.ZZ)
9883
node_version=$(node -v | cut -c2-)
9984
# Check if required node version is installed
100-
if [[ $(major "$node_version") -lt "$required_node_version" ]]; then
85+
if [[ $(major "$node_version") -lt "$required_node_version" ]] ; then
10186
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
10287
exit 1
10388
fi
@@ -170,7 +155,7 @@ echo "✔ Installed Python dependencies" | print_success
170155
# Install pre-commit-hooks if --pre-commit option is given
171156
if [[ -n "${PRE_COMMIT}" ]]; then
172157
echo "Installing pre-commit hooks..." | print_info
173-
# Install pre-commit hook for ruff
158+
# Install pre-commit hooks
174159
pre-commit install
175160
echo "✔ Installed pre-commit hooks" | print_success
176161
fi

0 commit comments

Comments
 (0)