Skip to content

Conversation

@capitalistspz
Copy link

@capitalistspz capitalistspz commented Oct 15, 2025

If a sourcePath "foo/" is provided, basePath = "foo/".

Which results in basePath.Length + 1 being one character past the directory separator.
So for a file, bar, in source directory, foo, the argument to FormatArchivePath is $"{destDirectory}foo/ar" instead of the likely intended $"{destDirectory}foo/bar".

@coderabbitai
Copy link

coderabbitai bot commented Oct 15, 2025

Walkthrough

Revised archive planning in ThunderstoreCLI/Commands/BuildCommand.cs: when expanding directories, targetPath is now computed with Path.GetRelativePath(basePath, filename) instead of using a substring of the base path. The added plan entries no longer use EntryData.FromFile(filename); they use a lambda that supplies file bytes via File.ReadAllBytes(filename). Control flow, error handling, and public APIs remain unchanged.

Possibly related PRs

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main bug being fixed: incorrect path handling when source directory ends with a slash, causing the first character of filenames to be omitted.
Description check ✅ Passed The description clearly explains the root cause of the bug (basePath.Length + 1 calculation error) and provides a concrete example showing the incorrect vs. intended behavior.
✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 58d13f6 and 09b8e2f.

📒 Files selected for processing (1)
  • ThunderstoreCLI/Commands/BuildCommand.cs
🚧 Files skipped from review as they are similar to previous changes (1)
  • ThunderstoreCLI/Commands/BuildCommand.cs

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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