Skip to content

bashunit init accumulates a dead BASHUNIT_BOOTSTRAP line on every run #1175

Closed

Description

@Chemaclass

Problem

bashunit init comments out any existing BASHUNIT_BOOTSTRAP and appends a
fresh one — unconditionally, even when the value is unchanged. Three runs:

#BASHUNIT_BOOTSTRAP=tests/bootstrap.sh
#BASHUNIT_BOOTSTRAP=tests/bootstrap.sh
BASHUNIT_BOOTSTRAP=tests/bootstrap.sh

The scaffolded files are idempotent, so re-running init is otherwise safe and
people do it. Only .env grows.

.env is also the one file init writes without saying so — the other
three print > Created …, so someone reviewing what init touched before
committing would miss it.

Fix

Skip the rewrite when the setting already has the intended value, and report
each .env outcome:

> Created .env                              # first run
> .env already sets BASHUNIT_BOOTSTRAP      # re-run, unchanged
> Updated .env                              # value differed

Replacing a different value keeps working — that is what the comment-and-append
logic is for.

Activity

  1. self-assigned this
    on Aug 13, 2026
  2. Chemaclass commented on Aug 13, 2026

    @Chemaclass
    MemberAuthor

    Done in #1176 (merged).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

  • Status
    Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions