Skip to content

Conversation

zhogov
Copy link

@zhogov zhogov commented Mar 8, 2019

No description provided.

Copy link
Member

@dwnusbaum dwnusbaum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! Can you please add a regression test to DockerDSLTest along the lines of DockerDSLTest.build() specifically for a Dockerfile with spaces in it?

if ((arg == '-f' || arg.startsWith('--file')) && i < (parsedArgs.length - 1)) {
dockerfile = arg.startsWith('--file=') ? arg.split('=')[1] : parsedArgs[i+1]
// Trim leading and trailing quotes
dockerfile = dockerfile.replaceAll('''^'|'$|^"|"$''', "")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be a little clearer to use a / string. Also, do we need to make sure we don't trim mismatched quotes like 'foo"? Maybe better to use something like this:

Suggested change
dockerfile = dockerfile.replaceAll('''^'|'$|^"|"$''', "")
dockerfile = dockerfile.replaceAll(/^('|")(.*)(\1)$/, "$2")

@jglick
Copy link
Member

jglick commented Jun 28, 2022

I suspect this has already been fixed and so this PR can be closed @rsandell?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants