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] Moving file outside of folder creates error #161

Closed
Poaclu opened this issue Jan 6, 2024 · 0 comments
Closed

[BUG] Moving file outside of folder creates error #161

Poaclu opened this issue Jan 6, 2024 · 0 comments

Comments

@Poaclu
Copy link

Poaclu commented Jan 6, 2024

Environment

  • OS: Arch Linux
  • Dotter version: 0.13.1

Description

I moved some of my config files from inside folders to root.
Example : one of my files was in tmux/.tmux.conf, and I renamed it to just tmux at the folder root.

Once I updated the dotter global config file, I kept having errors (after at least 5 to 10 tries), for tmux it was this :

[ERROR] Failed to delete symlink "tmux/.tmux.conf" -> "/home/poaclu/.tmux.conf"
Caused by:
    detect symlink's current state
    get source state
    read contents of file that isn't symbolic or directory
    Not a directory (os error 20`

Every config file was up-to-date with my new config.
I then checked the .dotter/cache.toml file :

[symlinks]
tmux = "/home/poaclu/.tmux.conf"
"tmux/.tmux.conf" = "/home/poaclu/.tmux.conf"

I guessed the error came from there.
I then deleted the .dotter/cache.toml, redeployed dotter and it worked.

Reproduction

I don't know exactly how to reproduce it, but this error happened for 5 files that I did this action for (at the same time).
So I guess :

  • Having a config file in a folder
  • Moving the file at root
  • Possibly : renaming the file : for this file, . at the beginning and .conf at the end. (some of the other files I did rename, but only deleted the first . didn't get this error)
  • Redeploying dotter without emptying cache

Expected behavior

A clear and concise description of what you expected to happen :
I guess deleting absent files that are not in the dotfiles folder, or at least asking the user if the file is still in use ?

Actual behavior

I already explained what happened, please ask more questions if needed.
I reproduced the error and got this log :

[ INFO] [-] symlink "tmux/.tmux.conf" -> "/home/poaclu/.tmux.conf"
[ERROR] Failed to delete symlink "tmux/.tmux.conf" -> "/home/poaclu/.tmux.conf"
Caused by:
    detect symlink's current state
    get source state
    read contents of file that isn't symbolic or directory
    Not a directory (os error 20)
[ INFO] [+] symlink "tmux" -> "/home/poaclu/.tmux.conf"
[ERROR] Creating symlink "tmux" -> "/home/poaclu/.tmux.conf" but target exists and doesn't point at source. Skipping.
[ERROR] Some files were skipped. To ignore errors and overwrite unexpected target files, use the --force flag.

Here's a full version of my log, if needed

Don't hesitate to contact me if needed.

@Poaclu Poaclu closed this as not planned Won't fix, can't repro, duplicate, stale Jun 7, 2024
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

No branches or pull requests

1 participant