-
Notifications
You must be signed in to change notification settings - Fork 4
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
a conditional .INCLUDE throws error when file does not exist #18
Comments
Hi @dkebler , Just to confirm, the I could see a possible new feature to make the include file optional, maybe something like:
I'll grind on that some more, but in the meantime: Q: Does your If YES, then what you might do is modify your build script to compile it separately and then turn the If NO, i.e. your Dockerfile is just a pure text file (not templated), then you can turn your Let me know if either of those could work for you for now, and I'll think about how to make the include accept an optional flag for times when the included file may not exist. -TW PS: See the discussions here (issue #16) as it contains some overlap with this discussion. It also contains a starter makefile which could be useful for setting up a multi-file setup. |
@dkebler pls lemme know if you get a chance to read my msg - I'd like to continue the discussion. -TW |
finally gettting back to this. My workaround was simply to make temporary file with a comment therein if it doesn't exist. Not ideal but it works.
This also means I can remove the conditional in my template, so now just
|
In this case bash-tpl is not generating a bash script to be run later but a Dockerfile which is more a less a "static" file (i.e. can't do a "cat" later) . To include this file was simply a way to give the user a way to inject some additional custom lines into the Dockerfile so NO it doesn't have any templating code but NO I can not use cat as you suggest. |
if the file
"$BUILD_SRC/Dockerfile"
does not exist then the .INCLUDE statement is ignored BUT bash-tpl STILL seems to want to check that the .INCLUDE file exists thus throwing an error. This is unexpected.if
"$BUILD_SRC/Dockerfile"
exists it all works as expected.The text was updated successfully, but these errors were encountered: