You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However I would like to have an "empty" Content in this case when the ENV variable does not exist. You can of course circumvent this by somehow setting the ENV variable CURRENT_SCENARIO_DIR to some invalid path before starting the compilation, but is there not an easier way to fallback to something else?
The current behavior when the ENV variable does not exist is just failing to compile completely:
help: message: called `Result::unwrap()` on an `Err` value: LookupError { var_name: "CURRENT_SCENARIO_DIR", cause: NotPresent }
Another option (which would work for my use case) would be something like falling back to another ENV variable, so you could maybe do:
The text was updated successfully, but these errors were encountered:
rbozan
changed the title
Having a fallback when an ENV variable does not exist for interpolate-folder-path
Having a fallback when an ENV variable does not exist for interpolate-folder-pathApr 30, 2022
Well I guess for my use case I can also use [env] in my Cargo config as that would fix it. But still it would be nice if an folder does not exist it wouldn't panic but you can silently ignore it so the Content in this case would just be empty as well. The issue can be closed though if you don't agree
Hi, thanks for the crate,
Basically I have the interpolate-folder-path functionality enabled and use this piece of code for loading in the assets:
However I would like to have an "empty"
Content
in this case when the ENV variable does not exist. You can of course circumvent this by somehow setting the ENV variableCURRENT_SCENARIO_DIR
to some invalid path before starting the compilation, but is there not an easier way to fallback to something else?The current behavior when the ENV variable does not exist is just failing to compile completely:
Another option (which would work for my use case) would be something like falling back to another ENV variable, so you could maybe do:
#[folder = "($CURRENT_SCENARIO_DIR || $PWD)/output"]
Thanks
The text was updated successfully, but these errors were encountered: