You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fixes#672
I split this PR up into 4 commits. The first one is the bare minimum for the issue. The rest are just consistency corrections that we neckbeards at irc://chat.freenode.net/%23bash would always make.
Copy file name to clipboardExpand all lines: install.sh
+18-18Lines changed: 18 additions & 18 deletions
Original file line number
Diff line number
Diff line change
@@ -60,22 +60,22 @@ trap_with_arg() {
60
60
DID_CLEAN_UP=0
61
61
# the cleanup function will be the exit point
62
62
cleanup () {
63
-
if [ "$DID_CLEAN_UP"-eq 1 ];then
63
+
if [["$DID_CLEAN_UP"-eq 1 ]];then
64
64
return 0;
65
65
fi
66
66
DID_CLEAN_UP=1
67
67
68
-
if [ "$1"!="EXIT" ];then
68
+
if [["$1"!="EXIT"]];then
69
69
echo"An error occurred, caught SIG$1 on line $2";
70
70
71
-
if [[ "$MINIMIZE_DOWNTIME" ]];then
71
+
if [[ -n"$MINIMIZE_DOWNTIME" ]];then
72
72
echo"*NOT* cleaning up, to clean your environment run \"docker-compose stop\"."
73
73
else
74
74
echo"Cleaning up..."
75
75
fi
76
76
fi
77
77
78
-
if [[ !"$MINIMIZE_DOWNTIME" ]];then
78
+
if [[ -z"$MINIMIZE_DOWNTIME" ]];then
79
79
$dc stop &> /dev/null
80
80
fi
81
81
}
@@ -93,35 +93,35 @@ function ver () { echo "$@" | awk -F. '{ printf("%d%03d%03d", $1,$2,$3); }'; }
93
93
94
94
# Thanks to https://stackoverflow.com/a/25123013/90297 for the quick `sed` pattern
95
95
functionensure_file_from_example {
96
-
if [ -f"$1" ];then
96
+
if [[-f"$1"]];then
97
97
echo"$1 already exists, skipped creation."
98
98
else
99
99
echo"Creating $1..."
100
100
cp -n $(echo "$1"| sed 's/\.[^.]*$/.example&/')"$1"
101
101
fi
102
102
}
103
103
104
-
if [$(ver $DOCKER_VERSION)-lt$(ver $MIN_DOCKER_VERSION)];then
104
+
if [[ "$(ver $DOCKER_VERSION)"-lt"$(ver $MIN_DOCKER_VERSION)" ]];then
105
105
echo"FAIL: Expected minimum Docker version to be $MIN_DOCKER_VERSION but found $DOCKER_VERSION"
106
106
exit 1
107
107
fi
108
108
109
-
if [$(ver $COMPOSE_VERSION)-lt$(ver $MIN_COMPOSE_VERSION)];then
109
+
if [[ "$(ver $COMPOSE_VERSION)"-lt"$(ver $MIN_COMPOSE_VERSION)" ]];then
110
110
echo"FAIL: Expected minimum docker-compose version to be $MIN_COMPOSE_VERSION but found $COMPOSE_VERSION"
111
111
exit 1
112
112
fi
113
113
114
-
if [ "$RAM_AVAILABLE_IN_DOCKER"-lt"$MIN_RAM" ];then
114
+
if [["$RAM_AVAILABLE_IN_DOCKER"-lt"$MIN_RAM"]];then
115
115
echo"FAIL: Expected minimum RAM available to Docker to be $MIN_RAM MB but found $RAM_AVAILABLE_IN_DOCKER MB"
116
116
exit 1
117
117
fi
118
118
119
119
#SSE4.2 required by Clickhouse (https://clickhouse.yandex/docs/en/operations/requirements/)
120
120
# On KVM, cpuinfo could falsely not report SSE 4.2 support, so skip the check. https://github.com/ClickHouse/ClickHouse/issues/20#issuecomment-226849297
SUPPORTS_SSE42=$(docker run --rm busybox grep -c sse4_2 /proc/cpuinfo || :)
124
-
if(($SUPPORTS_SSE42==0));then
124
+
if[[ "$SUPPORTS_SSE42"-eq 0 ]];then
125
125
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."
0 commit comments