Double quote variable to prevent sh error

During build of the image, this error message appears:

    Step 12/27 : RUN if [ ${release} == 1 ] ; then         crystal build ./src/invidious.cr         --release         --static --warnings all         --link-flags "-lxml2 -llzma";     else         crystal build ./src/invidious.cr         --static --warnings all         --link-flags "-lxml2 -llzma";     fi
     ---> Running in 44d8a5cd1f96
    sh: 1: unknown operand

When double-quoting the variable according to [shellcheck's SC2086](https://github.com/koalaman/shellcheck/wiki/SC2086), the error notice is gone.
This commit is contained in:
mcnesium 2022-01-02 16:56:56 +01:00 committed by GitHub
parent a779cdd463
commit b814432204
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -18,7 +18,7 @@ COPY ./.git/ ./.git/
RUN crystal spec --warnings all \
--link-flags "-lxml2 -llzma"
RUN if [ ${release} == 1 ] ; then \
RUN if [ "${release}" == 1 ] ; then \
crystal build ./src/invidious.cr \
--release \
--static --warnings all \