Open CreMindES opened 3 years ago
It seems related. This example fails:
ARG BASE_IMAGE=alpine
ARG BASE_TAG=3.14.2
FROM $BASE_IMAGE:$BASE_TAG
RUN \
packages="colordiff make curl wget git gcc g++ jq" && \
if command -v apt-get >/dev/null 2>&1; then \
apt-get update && \
apt-get install --yes --no-install-recommends --no-upgrade \
${packages:+${packages}} \
bsdmainutils \
&& \
apt-get clean && \
apt-get autoclean && \
rm -rf /var/lib/apt/lists/*; \
elif command -v apk >/dev/null 2>&1; then \
mkdir -p /var/cache/apk && \
ln -s /var/cache/apk /etc/apk/cache && \
apk --no-cache update && \
apk --no-cache add \
${packages:+${packages}} \
util-linux \
libc-dev \
musl-dev \
&& \
apk cache clean; \
elif command -v dnf >/dev/null 2>&1; then \
dnf update && \
dnf install --assumeyes \
${packages:+${packages}} \
util-linux \
&& \
dnf clean all; \
elif command -v zypper >/dev/null 2>&1; then \
zypper update --no-confirm && \
zypper install --no-confirm \
${packages:+${packages}} \
util-linux \
&& \
zypper clean --all; \
fi
The parser.ParseBashCommand
function throws a panic:
panic: runtime error: index out of range [0] with length 0 [recovered]
panic: runtime error: index out of range [0] with length 0
The current semicolon handling -
convertSemicolonsToLexItems
- strategy duringParseBashCommandList
is flawed, as it modifies therawString
value in the resultingBashCommand
s.