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

Only symbolically link files #49

Open
SlyCedix opened this issue Jan 6, 2025 · 3 comments
Open

Only symbolically link files #49

SlyCedix opened this issue Jan 6, 2025 · 3 comments

Comments

@SlyCedix
Copy link
Contributor

SlyCedix commented Jan 6, 2025

For programs which place files inside of the user directories, such as logs and tempfiles, the program may place files in the dotfiles store, rather than next to the files that are linked.

Being able to generate the empty directory structure if it doesn't exist would be very useful. Especially when installing dotfiles in the following situations:

  • Program does not generate configuration directory automatically
  • Program has not been installed yet
  • Program has not been run yet

I specifically had this issue with glzr-io/glazewm and glzr-io/zebar on Windows when attempting to install my dotfiles on a system without either program having run for the first time. The files use this structure:

Before running tuckr set *, the .glzr directory does not exist inside of %USERPROFILE% my dotfiles look like this:

%APPDATA%/dotfiles/
├─ Configs/
│  ├─ glazewm_windows/
│  │  └─ .glzr/
│  │     └─ glazewm/
│  │        └─ config.yaml
│  └─ zebar_windows/
│     └─ .glzr/
│        └─ zebar/
│           └─ settings.json
├─ Hooks/
│  └─ zebar_windows/
│     └─ pre.bat # Builds a theme at zebar_windows/.glzr/zebar/neobrutal/
└─ Secrets/

After running tuckr set *, the %USERPROFILE% directory looks like this:

%USERPROFILE%
└─ .glzr/ # Sym-link to %APPDATA%/dotfiles/Configs/glazewm_windows/.glzr
   ├─ glazewm/
   │     └─ glazewm/
   │        └─ config.yaml
   └─ zebar/ # Sym-link to %APPDATA%/dotfiles/Configs/glazewm_windows/.glzr/zebar
      ├─ neobrutal/ 
      └─ settings.json

And the dotfiles directory has become polluted as follows:

%APPDATA%/dotfiles/
├─ Configs/
│  ├─ glazewm_windows/
│  │  ├─ .glzr/
│  │  │  ├─ glazewm/
│  │  │  │  └─ config.yaml
│  │  │  └─ zebar/ # Sym-link to %APPDATA%/dotfiles/Configs/glazewm_windows/.glzr/zebar
│  │  │        ├─ neobrutal/
│  │  │        └─ settings.json
│  └─ zebar_windows/
│     └─ .glzr/
│        └─ zebar/
│           ├─ neobrutal/  # Generated by pre.bat, contains a theme
│           └─ settings.json
├─ Hooks/
│  └─ zebar_windows/
│     └─ pre.bat
└─ Secrets/

And any log files generated by zebar or glazewm are now placed in their respective directories inside of the dotfiles store.

My current workaround is going to be creating a pre hook for both which generate the necessary destination directory structure, but to me it feels like this should be default behavior, or at the very least a flag that can be passed to tuckr.

@SlyCedix
Copy link
Contributor Author

SlyCedix commented Jan 6, 2025

The workaround that I described does not work due to the issue I outlined in #50, since the hook needs to run before tuckr add

@SlyCedix
Copy link
Contributor Author

SlyCedix commented Jan 6, 2025

Possibly fixed with the process described in #43

@RaphGL
Copy link
Owner

RaphGL commented Jan 6, 2025

Yes, you're correct. #43 started to fix this exact issue. When multiple hooks share an uncreated directory one of them will link it with no regard for the other ones so you'll just end up with one group swallowing the others. So I started writing a file tree so I can detect and prevent these issues. I've just been slow to implement it because I'd been distracted with other things and very very slowly chipping away at this problem.

@SlyCedix SlyCedix mentioned this issue Jan 13, 2025
5 tasks
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

2 participants