From b814432204af9a81b3382a196380b6364257c630 Mon Sep 17 00:00:00 2001 From: mcnesium Date: Sun, 2 Jan 2022 16:56:56 +0100 Subject: [PATCH] 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. --- docker/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 5f1c0a11..c73821da 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -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 \