Skip to content

Commit ce5834b

Browse files
authored
fix(install): Update exit status and fix premature exit (#375)
Update exit -1 to exit 1 in line with best practices Fixes premature exit of the script when checking for sse42 support. The script would exit before displaying the reason for failure to the user.
1 parent fd9bd10 commit ce5834b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

install.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,24 +49,24 @@ function ensure_file_from_example {
4949

5050
if [ $(ver $DOCKER_VERSION) -lt $(ver $MIN_DOCKER_VERSION) ]; then
5151
echo "FAIL: Expected minimum Docker version to be $MIN_DOCKER_VERSION but found $DOCKER_VERSION"
52-
exit -1
52+
exit 1
5353
fi
5454

5555
if [ $(ver $COMPOSE_VERSION) -lt $(ver $MIN_COMPOSE_VERSION) ]; then
5656
echo "FAIL: Expected minimum docker-compose version to be $MIN_COMPOSE_VERSION but found $COMPOSE_VERSION"
57-
exit -1
57+
exit 1
5858
fi
5959

6060
if [ "$RAM_AVAILABLE_IN_DOCKER" -lt "$MIN_RAM" ]; then
6161
echo "FAIL: Expected minimum RAM available to Docker to be $MIN_RAM MB but found $RAM_AVAILABLE_IN_DOCKER MB"
62-
exit -1
62+
exit 1
6363
fi
6464

6565
#SSE4.2 required by Clickhouse (https://clickhouse.yandex/docs/en/operations/requirements/)
66-
SUPPORTS_SSE42=$(docker run --rm busybox grep -c sse4_2 /proc/cpuinfo);
66+
SUPPORTS_SSE42=$(docker run --rm busybox grep -c sse4_2 /proc/cpuinfo || :);
6767
if (($SUPPORTS_SSE42 == 0)); then
6868
echo "FAIL: The CPU your machine is running on does not support the SSE 4.2 instruction set, which is required for one of the services Sentry uses (Clickhouse). See https://git.io/JvLDt for more info."
69-
exit -1
69+
exit 1
7070
fi
7171

7272
# Clean up old stuff and ensure nothing is working while we install/update

0 commit comments

Comments
 (0)