Skip to content

Commit

Permalink
Fix error when JEMALLOC_ENABLED is not set
Browse files Browse the repository at this point in the history
When loading profile.d/jemalloc we would get the below error. It boils
down to asking bash to do a string comparison when the left side wasn't
a string. The fix is to force the left side to be a string. So, if it's
unset, the comparison becomes `"" = "true"`.

```
/app/.profile.d/jemalloc.sh: line 5: [: =: unary operator expected
```

Fixes mojodna#1
  • Loading branch information
gaffneyc committed Feb 13, 2018
1 parent 375e64a commit 2a700b3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bin/compile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export PATH="$PATH:/app/vendor/jemalloc/bin"
# Configure LD_PRELOAD when JEMALLOC_ENABLED is set to "true". Setting this can
# be tricky for people and it occasionally changes with new versions.
if [ $JEMALLOC_ENABLED = 'true' ]; then
if [ "$JEMALLOC_ENABLED" = 'true' ]; then
export LD_PRELOAD="/app/vendor/jemalloc/lib/libjemalloc.so $LD_PRELOAD"
fi
EOF

0 comments on commit 2a700b3

Please sign in to comment.