SuperCuber / dotter

A dotfile manager and templater written in rust 🦀
The Unlicense
874 stars 46 forks source link

Is there a quick way to flat source directory when linking to target directory #121

Closed younger-1 closed 1 year ago

younger-1 commented 1 year ago

Environment

If applicable, provide the following details:

The question

I have this dotter source files. I want all the files under bin goto the target directory without sub-directory

├── bin/
│  ├── bew/
│  │  ├── bew.md
│  │  ├── blank-lines*
│  │  ├── chronometer
│  │  ├── cli-clipboard-provider
│  │  ├── color256text
│  │  ├── colortest
│  │  └── imgcat*
│  ├── fzf/
│  │  ├── fzf-panes.tmux*
│  │  ├── fzf.md
│  │  └── fzfp*
│  ├── ix.sh*
│  ├── osc52.sh*
│  ├── paste.sh*
│  ├── test.sh*
│  └── util.sh

So instead of writing the dotter config like this,

bin = { target = "~/bin", type = "symbolic" }

I can flat it when linking to target directory by write this:

bin = { target = "~/bin", type = "symbolic" }
"bin/bew" = { target = "~/bin", type = "symbolic" }
"bin/fzf" = { target = "~/bin", type = "symbolic" }

This works like a charm! Thanks for your great work! I want to know if there is a way I could do it more efficiently? Or is it possible to add feature like this:

# flat all sub dirs, recursively
bin = { target = "~/bin", type = "symbolic", flat_sub_dirs = true }

# (optional) only flat provided sub dirs, recursively
bin = { target = "~/bin", type = "symbolic", flat_sub_dirs = { 'bew', 'fzf' } }
SuperCuber commented 1 year ago

i haven't tried doing this myself, but I'm glad it works for you 🙃 I don't think this feature would be useful enough for first-class support though

younger-1 commented 1 year ago

Okay, thanks anyway