Config in CWD and resolve ABRA_DIR #4
Reference in New Issue
Block a user
No description provided.
Delete Branch "eCommons/alakazam:config-location"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Added support for reading alakazam.yml from CWD and fallback to ~/.config/alakazam.yml. This allows working with a completely separate path for e.g. development.
I also had abra configured with a different abra_dir. When alakazam runs abra, it uses the configured abra dir, but alakazam also had some hardcoded references to ~/.abra. I added get_abra_dir() with the same logic that abra uses internally and replaced all hardcoded references.
Woah, super cool @dannygroenewegen! Great to see this happening. Driving by but LGTM! Not to demand too much but probably it would be pretty easy to create a unit test for
get_abra_dir. We have to start writing tests eventually 🙃 I trust @moritz will know better.Thank you for this PR 🚀. It's a nice feature to be able to have completely different project dirs, each separately configured.
I'm just curious for which use cases you use it? I think it's good if you don't want to have any global defaults for all of your projects. Else you would have all of your projects inside one main directory, which contains your global defaults.
On thing that stopped me from directly merging this, is that it only uses the
alakazam.ymlinside the current path, but if you runalakazamfrom any sub directory in your project it would fall back to"~/.config/alakazam.yml", which could lead to some confusing behaviour.@ -55,3 +55,3 @@#}SETTINGS = {}SETTINGS_PATH = "~/.config/alakazam.yml"SETTINGS_PATH = "alakazam.yml" if Path("alakazam.yml").exists() else "~/.config/alakazam.yml"To be able to use the project specific
alakazam.ymlin nested directories, it would be good to use a function similar toget_abra_dir()to findalakazam.ymlinside the parent dirs.@ -467,8 +467,27 @@ def generate_all_secrets(domain: str) -> None:print(f"\t {gen_sec['name']}: {gen_sec['value']}")def get_abra_dir() -> Path:A little docstring what this function is doing would be nice.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.