Skip to content

[Feature Request] Conditional imports #195

@theoephraim

Description

@theoephraim

Description

Allow importing a file only if a condition is met. For example:

# @import(./.env.some-file, enabled=eq(SOME_VAR, "some val")
# ---

Proposed Solution

Add a new enabled property to the @import decorator which will decide whether or not to proceed based on some boolean.

Alternatives

Currently, you could always import the file and use @disabled

Alternatively, we could think about introducing a higher level if block concept, that could enable/disable multiple arbitrary lines within the env file. Not sure it is worth the complexity.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions