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

Subdirectory {{ name }} includes path β€” creates issue for defaults.yaml in subdirectories #337

Open
gwenwindflower opened this issue Apr 22, 2024 · 2 comments

Comments

@gwenwindflower
Copy link

First off, fantastic package! My dotfiles are sooo much cleaner than when my old dotbot iteration, zero regrets on making the jump, thanks for your hard work on this πŸ’—βœ¨.

One thing I just encountered in trying to refactor from using a giant Brewfile to relying on Rotz for my brew installs: it seems that the {{ name }} of a subdirectory within a subdirectory includes the parent subdirectory. This makes it impossible (? or tricky at least) to use a defaults.yaml with a package manager to install using the suggested pattern:

# defaults.yaml
installs:
  cmd: brew install {{ name }}
  depends:
    - brew

For example, with the below setup (tools dir is in the root of my dotfiles), the above pattern attempts to do this brew install tools/yazi, brew install tools/atuin...etc.

tools
β”œβ”€β”€ atuin
β”‚Β Β  β”œβ”€β”€ atuin.toml
β”‚Β Β  └── dot.yaml
β”œβ”€β”€ dbt
β”‚Β Β  └── dot.yaml
β”œβ”€β”€ defaults.yaml
β”œβ”€β”€ dust
β”‚Β Β  └── dot.yaml
β”œβ”€β”€ karabiner
β”‚Β Β  β”œβ”€β”€ dot.yaml
β”‚Β Β  └── karabiner.json
β”œβ”€β”€ sunbeam
β”‚Β Β  β”œβ”€β”€ dot.yaml
β”‚Β Β  └── xn.py
└── yazi
    β”œβ”€β”€ Catppuccin-frappe.tmTheme
    β”œβ”€β”€ dot.yaml
    β”œβ”€β”€ keymap.toml
    β”œβ”€β”€ theme.toml
    └── yazi.toml

This is on MacOS Sonoma 14.4.1, Rotz version 0.10.0. Let me know if you need other details. Thanks again!

@gwenwindflower
Copy link
Author

gwenwindflower commented Apr 22, 2024

Secondary but related question that I couldn't determine from from the docs: if you have a dot that completely follows the default β€” for example, in my dotfiles asciicinema is just a brew install asciicinema -- should you have a dot.yaml in the asciicinema directory with installs: true or just a .gitkeep? Or would both work?

@gwenwindflower
Copy link
Author

figured out the answer to the follow-up question via trial and error for anybody who has the same question: pattern that works for me on MacOS is that you do need a dot.yaml file, but you need installs: null or installs: (blank, equivalent) to have it fall back to the default.

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