stow icon indicating copy to clipboard operation
stow copied to clipboard

`--dotfiles` does not work for non existing paths

Open lfk-dev opened this issue 1 month ago • 2 comments

I moved systems recently and I spotted weird behaviour by stow. I don't know if that is on purpuse, but if a directory does not exist, GNU stow symlinks to wrong paths instead of throwing an error.

this is my zsh package

zsh
├── dot-config
│   └── zsh
│       ├── dot-zprofile
│       ├── dot-zshenv
│       └── dot-zshrc
└── dot-zshenv

There is no ~/.config directory. After running: stow -t $HOME -d $HOME/repos/dotf --dotfiles -v zsh The output:

LINK: .config => repos/dotf/zsh/.config
UNLINK: .config (reverts previous action)
MKDIR: .config
LINK: .config/zsh => ../repos/dotf/zsh/dot-config/zsh

This creates the ~/.config with following structure:

.config
└── zsh -> ../repos/dotf/zsh/dot-config/zsh

Inside the ~/.config/zsh:

-rw-rw-r-- 1 user user   74 Nov 16 22:32 dot-zprofile
-rw-rw-r-- 1 user user 1561 Nov 23 08:35 dot-zshenv
-rw-r--r-- 1 user user 3201 Nov 25 17:01 dot-zshrc

The files names where not converted to . prefix and they where not symlinked. Deleting ~/.config, running mkdir -p ~/.config/zsh and then re-running the same stow command fixes the issue.

lfk-dev avatar Nov 25 '25 16:11 lfk-dev

Please can you confirm which version you're using?

aspiers avatar Nov 29 '25 16:11 aspiers

stow 2.4.1

lfk-dev avatar Nov 30 '25 07:11 lfk-dev

Damn, sounds like a genuine bug. I'm hoping to spend some time catching up with the Stow backlog over the Christmas break, will try to take a look then.

aspiers avatar Dec 12 '25 18:12 aspiers