Search code examples
visual-studio-codemustache

Can't use Mason Brick's conditionals for generating file in VSCode


I can't use Mason brick's conditional file generation because VS Code automatically create nested folders if I use folder1/folder2 approach while creating new file. For conditional generation it's required to create file following mustache syntax, for example: {{#boolean_var}}file_name.dart{{/boolean_var}}.

I've tried to achieve conditional file generation in my local Mason brick following BrickHub's docs and Observable Flutter: Building a Mason brick YouTube video in VS Code. Also I've tried to search how to disable automatic nested folder creation in VS Code, but didn't find any flags in settings.

I expect that VS Code will create file with name {{#enable_binding}}binding.dart{{/enable_binding}}, but it creates folder with name {{#enable_binding}}binding.dart{{ and file inside with name enable_binding}}.

attempt

result


Solution

  • Felix Angelov (main contributor of BrickHub) answered here with working solution: use \ instead of / during file creation in VS Code. It works