Skip to content

Handle existing directory gracefully#91

Open
samuel-rajanala wants to merge 3 commits into
Shpota:mainfrom
samuel-rajanala:fix-typo
Open

Handle existing directory gracefully#91
samuel-rajanala wants to merge 3 commits into
Shpota:mainfrom
samuel-rajanala:fix-typo

Conversation

@samuel-rajanala

@samuel-rajanala samuel-rajanala commented Jun 6, 2026

Copy link
Copy Markdown

Summary

This change improves error handling when the target repository directory already exists.

Previous behavior

Running contribute.py multiple times against the same repository caused:

FileExistsError: [WinError 183]

New behavior

The script checks whether the directory already exists and exits gracefully with a helpful message instead of crashing.

Tested

  • Windows 11
  • Python 3.14.5

Copilot AI review requested due to automatic review settings June 6, 2026 01:24

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Adds a guard to prevent initializing a new git repository in a path that already exists, exiting early with user-facing messaging.

Changes:

  • Check for an existing target path before creating/chdir into the repository directory.
  • Print guidance and exit if the directory already exists.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread contribute.py Outdated
Comment thread contribute.py Outdated
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.

2 participants