Closed aeldemery closed 3 years ago
While it's a little awkward, I think we want the regex to match the default value. If it doesn't, then the template needs to be corrected.
Ok, now I understand what the problem is. If I put the default value as one of the project variables, it may fail as it's not get substituted.
example:
If I made a variable ${APP_REAL_NAME}
and put the default as ${PROJECT_NAME}
it fails because it test the regex against ${PROJECT_NAME}
not its value. It's also not very convenient as it doesn't display the substituted value to the user. Any idea how to solve this?
@aeldemery usually you'd want to reference a variable to copy it in some modified form. Therefore, your default should be of the form /${OTHER_VARIABLE}/<non-empty match pattern>/<possibly empty replacement pattern>/
. If you're defining a variable to be exactly another variable, then you just use that variable instead in your template files, right?
@aeldemery I pushed some fixes to substitution recently. Maybe it helps with your problem. Let me know how I can help you with making a template.
If the user press enter without input, the regex test fails, so test it only if non default value.