According to docs conditional truthy could also be used include/exclude files or directories . how can I do it in practice ? if I add all the files and directories to the template, how can I exclude them from the project based on the condition ?
* According to this issue, it is not possible but according to the docs (IIUC) it should work. This is pretty confusing
How to include/exclude files using Giter8
330 views Asked by igx At
1
If you don't want to include some files, you should set its name to be something like
$if(some_condition.truthy)$your_file_name.scala$endif$When
some_conditionis false, this file won't be created.There are some examples in http4s.g8. In directory
src/main/g8/, there is a file called$if(graal_native_image.truthy)$native-image-readme.md$endif$. If the variablegraal_native_imageis set to true, a file namednative-image-readme.mdwill be created. Otherwise, this file won't be created.This method is also worked for directories, as long as you use the same pattern for the directory name.