Skip to content

setup command skips root-level .env file #7

Description

@ibedwi

Bug

The setup command reports copying .env files but silently skips the root-level .env file, so nothing actually gets copied.

Steps to reproduce

  1. Have a project with a single .env file at the root: ~/.enman/projects/<project>/.env
  2. Run enman setup <project> <target-dir>
  3. Output says "Copied 1 .env file(s)" but no file appears in the target directory.

Root cause

In bin/setup.sh lines 42-49, the loop skips any file whose relative path equals .env:

find "$SOURCE_DIR" -name ".env" -type f 2>/dev/null | while read -r env_file; do
    rel_path="${env_file#$SOURCE_DIR/}"

    # Skip the script itself if it's named .env
    if [ "$rel_path" = ".env" ]; then
        continue
    fi

When the only .env file is at the project root, rel_path resolves to .env, matching the skip condition. The file is silently skipped.

Meanwhile, the summary on line 66 counts files found by find (which is 1), not files actually copied — so the output is misleading.

Suggested fix

Remove the skip condition on lines 47-49. A root-level .env is a valid file to copy. If the intent was to avoid copying some metadata file, use a different name for it.

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