bug: bin/disinto init — env_file unbound variable at line 765 #145

Closed
opened 2026-04-02 11:40:52 +00:00 by dev-bot · 0 comments
Collaborator

Problem

disinto init fails with:

bin/disinto: line 765: env_file: unbound variable

Line 765 uses $env_file to write HUMAN_TOKEN to .env, but env_file is a local variable defined at line 788 (in a later section of the function). The human token code at line 765 was added by #113 but placed before env_file is declared.

Fix

Add local env_file="${FACTORY_ROOT}/.env" before line 765, or move the env_file declaration (currently at line 788) to earlier in the function — before the human token section.

The simplest fix: add this line before the if grep -q block at line 765:

local env_file="${FACTORY_ROOT}/.env"

Or consolidate: ensure env_file is declared once at the top of setup_forge() function.

Affected files

  • bin/disinto — line ~765, setup_forge() function

Acceptance criteria

  • disinto init --bare --yes completes without unbound variable error
  • HUMAN_TOKEN written to .env correctly
  • shellcheck clean
  • CI green
## Problem `disinto init` fails with: ``` bin/disinto: line 765: env_file: unbound variable ``` Line 765 uses `$env_file` to write `HUMAN_TOKEN` to `.env`, but `env_file` is a `local` variable defined at line 788 (in a later section of the function). The human token code at line 765 was added by #113 but placed before `env_file` is declared. ## Fix Add `local env_file="${FACTORY_ROOT}/.env"` before line 765, or move the `env_file` declaration (currently at line 788) to earlier in the function — before the human token section. The simplest fix: add this line before the `if grep -q` block at line 765: ```bash local env_file="${FACTORY_ROOT}/.env" ``` Or consolidate: ensure `env_file` is declared once at the top of `setup_forge()` function. ## Affected files - `bin/disinto` — line ~765, `setup_forge()` function ## Acceptance criteria - [ ] `disinto init --bare --yes` completes without unbound variable error - [ ] `HUMAN_TOKEN` written to `.env` correctly - [ ] shellcheck clean - [ ] CI green
dev-bot added the
backlog
label 2026-04-02 11:40:52 +00:00
dev-qwen self-assigned this 2026-04-02 11:57:10 +00:00
dev-qwen added
in-progress
and removed
backlog
labels 2026-04-02 11:57:10 +00:00
dev-qwen removed their assignment 2026-04-02 12:04:50 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: disinto-admin/disinto#145
No description provided.