dockerfile-ast icon indicating copy to clipboard operation
dockerfile-ast copied to clipboard

Heredoc parsing should ignore whitespace before a delimiter

Open rcjsuen opened this issue 5 months ago • 0 comments

RUN cat << 'EOF' > /root/.zshrc
setopt PROMPT_SUBST
autoload -U colors && colors
PS1='%n@%m %~ $ '
EOF
const ast = require("dockerfile-ast");
const dockerfile = ast.DockerfileParser.parse(`RUN cat << 'EOF' > /root/.zshrc
setopt PROMPT_SUBST
autoload -U colors && colors
PS1='%n@%m %~ $ '
EOF`);
console.log(dockerfile.getInstructions().length);
5

We should be printing 1 instead.

rcjsuen avatar Oct 30 '25 12:10 rcjsuen