Comments (6)
Hi @feinstein 👋
Can you please provide a minimal reproduction sample? Thanks!
from mason.
Sure :)
Add this variable to your brick.yaml
:
shouldGenerateExample:
type: boolean
description: If an example feature should be generated
default: false
prompt: Generate example code?
And create a json file with contents like:
{
...
"shouldGenerateExample": "false"
}
Create a folder named {{#shouldGenerateExample}}example_feature{{
and inside it put another named shouldGenerateExample}}
and inside this folder place some files.
Now call make my_brick_name -o ./test_app -c test_properties.json
and the example_feature
folder will be created, even though the variable was set as false
. I think this happens because mustache checks for a key's existence and not its value.
from mason.
Sure :)
Add this variable to your
brick.yaml
:shouldGenerateExample: type: boolean description: If an example feature should be generated default: false prompt: Generate example code?And create a json file with contents like:
{ ... "shouldGenerateExample": "false" }Create a folder named
{{#shouldGenerateExample}}example_feature{{
and inside it put another namedshouldGenerateExample}}
and inside this folder place some files.Now call
make my_brick_name -o ./test_app -c test_properties.json
and theexample_feature
folder will be created, even though the variable was set asfalse
. I think this happens because mustache checks for a key's existence and not its value.
Are you sure this isn’t due to the fact that you’re setting the variable to the string “false”?
Have you tried changing your json to:
{
...
"shouldGenerateExample": false
}
from mason.
@feinstein closing this for now since I believe there are no actionable steps to be taken. Let me know if my suggestion does not work for you and I’m happy to take a closer look.
from mason.
Related Issues (20)
- fix: multiline progress logs HOT 2
- [Not Bug Just Ask] How do you create a terminal gift record?
- fix: pushd fail in post_gen hook HOT 2
- fix: Can't load Kernel binary: Invalid kernel binary format version HOT 8
- fix: Postgen hook fails with error HOT 10
- feat: Let lambdas be available into hooks HOT 2
- Wrong path format at brick generation. Slash "/" formatted to `/` HOT 2
- fix: type 'Null' is not a subtype of type 'Object' HOT 3
- feat(mason): allow packages that use `MasonGenerator` to acess `BrickVariableProperties`. HOT 1
- fix: cannot ctrl+C when `chooseOne` menu is shown HOT 4
- File not showing in Intellij Idea when using conditionals in folder name
- docs: Can I show or hide text based on whether a list item has been selected
- feat: Make variables without a default value mandatory HOT 2
- feat: Create folders from array HOT 2
- fix: mason bundle doesnt keep filesystem permissions of incldued files
- fix: dart pub global activate mason_cli not working HOT 6
- Ignore mustache interpolation in brick source file/files HOT 2
- feat: create an required variable so we can declare our own variable to help with repetitive lambda HOT 1
- fix: Can't create conditional files on a Mac HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mason.