Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Create mulitple directories with files with loop #1430

Open
blingkonnerth opened this issue Sep 20, 2024 · 0 comments
Open

feat: Create mulitple directories with files with loop #1430

blingkonnerth opened this issue Sep 20, 2024 · 0 comments

Comments

@blingkonnerth
Copy link

Description

I know, you can also have loop in files. But is there also a way to use loops to create files from given args?

This is the structure I would like to accomplish:

my_example_flow/
├── view.dart               # Contains the MyExampleFlow class
└── views/
    ├── view_1/
    │   └── view.dart       # Contains class MyExampleFlowView1
    ├── view_2/
    │   └── view.dart       # Contains class MyExampleFlowView2
    └── view_3/
        └── view.dart       # Contains class MyExampleFlowView3

But the number of views should be dynamic.

My yaml currently looks like this:

name: view_brick
description: Generates views and a flow structure
version: 0.1.0+1
environment:
  mason: ">=0.1.0-dev.41 <0.1.0"

vars:
  flow_name:
    type: string
    description: "The name of the general flow"
  views:
    type: string
    description: "Comma-separated list of views (PascalCase, e.g. View1,View2)"

But I am stuck now. How do I get the above structure? Let me know if you need any more information! Is something like this even possible with mason?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant