dockerfile-ast
dockerfile-ast copied to clipboard
Heredoc parsing should ignore whitespace before a delimiter
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.