-
Notifications
You must be signed in to change notification settings - Fork 6
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
I want a parameter in TextFile
that will cause a compile error if the file specified in Path
does not exist.
#14
Comments
One way to ensure the existence of the file is to use the non-parameterized version of the provider, ie instead of But now I realize that you might want to provide the path as a string anyway (perhaps because it itself comes from another LiteralProvider), so yeah then this makes sense. |
In my situation I had to specify the file path of the project's parent hierarchy (for example, |
There's actually another improvement that could be done, and would also solve your issue: making the non-parameterized version also provide a Textfile.``..``.``..``.misc.``foobar.txt`` |
Released in v0.4 as |
In the current implementation of
TextFile
,DefaultValue
is used for theText
member if the file specified inPath
does not exist. IfDefaultValue
is not specified, it will be an empty string.If the contents of the file should always be used, but a non-existent file path is specified (for example, due to a mistake in the file path, a change in the file name, or a difference in the build environment), empty string is used as
DefaultValue
and no error occurs. This can cause unexpected bugs.I think there is a way, for example, to add a
bool
type parameter namedUseDefaultValue
and raise an exception if the file is not found and this parameter isfalse
.The text was updated successfully, but these errors were encountered: