addyosmani / addyosmani/git2txt

Bug: Output filename incorrectly generated for certain GitHub URL formats

Đang mở
#13 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
JavaScript
Star
564
Fork
58
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

## Description
The `git2txt` tool sometimes generates incorrect output filenames when processing certain GitHub repository URL formats. This happens because the repository name extraction logic doesn't handle all URL formats consistently.

## Steps to Reproduce
1. Run the tool with a GitHub URL ending in a slash:
```bash
git2txt https://github.com/username/repository/
```
Expected: Output file named `repository.txt`
Actual: Output file named `.txt`

2. Run the tool with a short format URL:
```bash
git2txt username/repository
```
Expected: Output file named `repository.txt`
Actual: Output file named `repository.txt` (works correctly)

3. Run the tool with an SSH URL:
```bash
git2txt git@github.com:username/repository
```
Expected: Output file named `repository.txt`
Actual: Output file named `repository` (missing .txt extension)

## Impact
- Users get unexpected output filenames
- Some formats result in files without the .txt extension
- URLs with trailing slashes create files named just `.txt`

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.