Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot get comments within a build stage #54

Closed
rcjsuen opened this issue Apr 22, 2019 · 0 comments
Closed

Cannot get comments within a build stage #54

rcjsuen opened this issue Apr 22, 2019 · 0 comments
Assignees
Labels

Comments

@rcjsuen
Copy link
Owner

rcjsuen commented Apr 22, 2019

It seems like we only add comments to the Dockerfile but not an ImageTemplate.

import { DockerfileParser } from 'dockerfile-ast';
let dockerfile = DockerfileParser.parse("FROM scratch\n# comment\nRUN echo \"$VAR\"");
let image = dockerfile.getContainingImage({ line: 2, character: 1 });
console.log(image.getComments().length);

The above code returns 0 instead of 1. :(

@rcjsuen rcjsuen self-assigned this Apr 22, 2019
@rcjsuen rcjsuen added the bug label Apr 22, 2019
rcjsuen added a commit that referenced this issue Apr 25, 2019
The changes introduced in #54 caused contains(*) to no longer
consider comments and directives if it was being called on a
Dockerfile.

Signed-off-by: Remy Suen <remy.suen@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant