Skip to content

Conversation

@ldkv
Copy link
Contributor

@ldkv ldkv commented Nov 27, 2025

This PR replaces symlink with Windows junction on Windows OS.

It allows to link a directory on Windows without admin privileges or Developer Mode. Should address #5


Note

Adds cross-platform link utilities that create Windows junctions as needed and updates CLI, project logic, and tests to recognize them.

  • Core Utilities:
    • Add src/uvlink/path_utils.py with is_windows, is_link_or_junction, path_exists, create_windows_junction, and create_symlink (fallback to junctions on Windows).
  • CLI (src/uvlink/cli.py):
    • Refactor link to use path_exists for existence checks and create_symlink for creation; streamline prompts and creation flow.
  • Project (src/uvlink/project.py):
    • Update rm_rf to remove links via is_link_or_junction.
    • Compute is_linked using is_link_or_junction in Projects.get_list.
  • Tests:
    • Accept junctions in link assertions (is_symlink() or is_junction()), add non-existence check for junctions in dry-run, and use create_symlink in project path resolution tests.
    • Simplify unlink with unlink(missing_ok=True).

Written by Cursor Bugbot for commit 4b04326. This will update automatically on new commits. Configure here.

@c0rychu
Copy link
Owner

c0rychu commented Nov 28, 2025

Yeah, splitting them into two would be better.

Also, could you change the target branch to c0rychu:support-windows, which makes it easier for me.

Copy link
Owner

@c0rychu c0rychu left a comment

Choose a reason for hiding this comment

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

Some comments

@ldkv ldkv changed the base branch from main to support-windows November 28, 2025 13:40
@ldkv
Copy link
Contributor Author

ldkv commented Nov 28, 2025

Yeah, splitting them into two would be better.

Also, could you change the target branch to c0rychu:support-windows, which makes it easier for me.

Done. I only keep the junction update for this PR. Will add the tests adaptation in another.

@ldkv ldkv mentioned this pull request Nov 28, 2025
Copy link
Owner

@c0rychu c0rychu left a comment

Choose a reason for hiding this comment

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

@ldkv thank you so much for your work!

  1. Sorry for being a little picky and opinionated here, but these are my comments/suggested changes.
  2. If the Windows-only test that mocks the except OSError requires too much work, we can merge this PR first and create that test later as long as you verify that it's working on your Windows machine.
  3. It would be nice to add docstrings with Google style, but I can also ask codex-cli to do that afterwards, so either way, don't worry about it.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

This PR is being reviewed by Cursor Bugbot

Details

You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

Copy link
Owner

@c0rychu c0rychu left a comment

Choose a reason for hiding this comment

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

Address comments from cursor bugbot

@c0rychu c0rychu marked this pull request as draft November 28, 2025 16:27
@ldkv ldkv requested a review from c0rychu November 28, 2025 19:11
@ldkv
Copy link
Contributor Author

ldkv commented Nov 28, 2025

@ldkv thank you so much for your work!

1. Sorry for being a little picky and opinionated here, but these are my comments/suggested changes.

2. If the Windows-only test that mocks the `except OSError` requires too much work, we can merge this PR first and create that test later as long as you verify that it's working on your Windows machine.

3. It would be nice to add docstrings with Google style, but I can also ask `codex-cli` to do that afterwards, so either way, don't worry about it.

Hey no worry, your product your call. Your comments are good too. I will let you update the docstrings as you like, personally I find the type annotations suffice.

I will add a test for the OSError in the 2nd PR.

Copy link
Owner

@c0rychu c0rychu left a comment

Choose a reason for hiding this comment

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

Great!

@c0rychu c0rychu marked this pull request as ready for review November 28, 2025 19:31
@c0rychu
Copy link
Owner

c0rychu commented Nov 28, 2025

@cursor review

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no bugs!


@c0rychu c0rychu merged commit 9d73d95 into c0rychu:support-windows Nov 28, 2025
8 of 11 checks passed
@ldkv ldkv deleted the windows-junction branch November 28, 2025 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants