Skip to content

Fix init failing when mobs_dir is outside repo root#21

Merged
blipinsk merged 1 commit intomainfrom
fix/init-external-mobs-dir
Mar 26, 2026
Merged

Fix init failing when mobs_dir is outside repo root#21
blipinsk merged 1 commit intomainfrom
fix/init-external-mobs-dir

Conversation

@blipinsk
Copy link
Copy Markdown
Member

@blipinsk blipinsk commented Mar 26, 2026

Summary

  • SaveConfig now ensures .codemob/ exists before writing config.json
  • Fixes codemob init failing when the user picks an external mobs directory (enclosing or global), since MkdirAll only created the external path but never the in-repo .codemob/

Test plan

  • Run codemob init and pick option 2 (enclosing dir) - should succeed
  • Run codemob init and pick option 3 (global dir) - should succeed
  • Run codemob init and pick option 1 (project dir) - should still work as before

SaveConfig wrote to .codemob/config.json but never ensured the
.codemob/ directory existed inside the repo. When the user picks
an external mobs directory (enclosing or global), MkdirAll only
creates the external path, so the in-repo .codemob/ is never made
and the config write fails.
@blipinsk blipinsk enabled auto-merge (squash) March 26, 2026 11:31
@blipinsk blipinsk merged commit ea49433 into main Mar 26, 2026
1 check passed
@blipinsk blipinsk deleted the fix/init-external-mobs-dir branch March 26, 2026 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant