Skip to content

Declaring variables without prompt #79

@vedoa

Description

@vedoa

Currently, creating a dynamic folder structure based on a user specified domain (e.g., com.github.test) requires user interaction or an additional prompt to work. The best i could come up with was the template structure

{{package_path}}/
├── Something.java

and the configuration template.toml

name = "test"
kickstart_version = 1
description = "Folder structure"

[[variables]]
name = "package"
default = "com.github.test"
prompt = "Enter your package name (dot-separated):"
validation = "^[a-z]+(\\.[a-z][a-z0-9_]*)*$"


[[variables]]
name = "package_path"
default = "{{ package | replace(from='.', to='/')}}"
prompt = "(auto-generated, press Enter)"

It would be nice to be able to declare variables without prompting the user for input - mostly derived variables to declare a folder structure is what i am aiming for. I couldn't figure out a way to do it.

In the example above i can't encode {{ package | replace(from='.', to='/')}} as the folder name and can't declare a variable without a prompt.

Any help appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions