Skip to content

[Feature] Allow optional loading of env files in .prototools #906

@lexi2042

Description

@lexi2042

The Problem
Currently, if an [env] file is defined in .prototools, proto (and downstream tools like moon ci) will hard fail/panic if that file does not exist.

This causes issues in CI/CD environments and Docker builds where .env files are intentionally excluded (gitignored) and secrets are injected via the environment variables directly.

Example Configuration

[env]
file = ".env"

Observed Behavior
If .env is missing, the proto Activate workflow or moon ci breaks.

Proposed Solution
Add a configuration parameter to specify if the env file is strictly required.

I suggest adding a file-required flag. To avoid a breaking change for existing users, this could default to true, but allow false for CI environments.

[env]
file = ".env"
# Suggested config option
file-required = false

Expected Behavior
With file-required = false, if the file is missing, proto should silently ignore the missing file and continue execution rather than failing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions