Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Using recurse=false on window creates a file symlink instead of dir. #101

Closed
LucasOe opened this issue Jun 23, 2022 · 5 comments
Closed
Labels

Comments

@LucasOe
Copy link

LucasOe commented Jun 23, 2022

Environment

  • OS: Windows 10 21H2
  • Dotter version: 0.12.11

Description

When using the option recurse=false on a symbolic link, dotter creates a file symlink instead of linking the directory.

Reproduction

Create any symbolic link with recurse=false. Example:

[test.files]
"mydir" = { target = "~/mydir", type="symbolic", recurse=false }

Expected behavior

Because using recurse=false would only make sense when linking directories, I would expect ~/mydir to be a directory.

Actual behavior

The created symlink is a file symlink instead of a dir symlink, making it impossible to see the content of the linked directory. The created symlink should have the mode l-r-- but it's mode is la--- instead, when inspecting it with ls. Changing the Rust function linked above when not linking recursively should be enough to fix this issue.

@SuperCuber SuperCuber added the bug label Jun 25, 2022
@SuperCuber
Copy link
Owner

I cannot reproduce this - current code for me creates a symlink with mode lrwxrwxrwx when running ls -Ahl on git-bash, and commands like cd mydir and ls mydir work as I'd expect.

I could implement a fix that checks if the source file is a dir and uses the appropriate function but I wouldn't be able to verify that it works.

@SuperCuber
Copy link
Owner

funnily enough I'm getting this:

the solution is rm mydir without the slash

@LucasOe
Copy link
Author

LucasOe commented Jun 25, 2022

I can cd into the symlink when using the Git Bash, but not with PowerShell 7.2.5. You also can't navigate the file in the Explorer.

@SuperCuber
Copy link
Owner

You also can't navigate the file in the Explorer.

This I can reproduce, pushing a fix soon :)

@LucasOe
Copy link
Author

LucasOe commented Jun 25, 2022

That was fast, thanks for the fix :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants