shells: trigger hook when .(cade|envrc) exists in PWD with cache#8
Draft
plumj-am wants to merge 1 commit into
Draft
shells: trigger hook when .(cade|envrc) exists in PWD with cache#8plumj-am wants to merge 1 commit into
plumj-am wants to merge 1 commit into
Conversation
Hooks reload when a .(cade|envrc) file is present in PWD, without needing a PWD change or updated __CADE_LAYERS. It's cached so the stat only runs after a reload. Otherwise, it's possible for cade to be allowed but not "active" yet, according to the status: ``` ^pwd /home/jam/projects/test-cade ^cade allow cade is now allowed in /home/jam/projects/test-cade. ^cade status cwd: /home/jam/projects/test-cade root: /home/jam/projects/test-cade layers (inner → outer): /home/jam/projects/test-cade [allowed, composed] active: no ``` Signed-off-by: PlumJam <git@plumj.am>
Contributor
|
I suspect this is more elegantly solving some things intended by #5 , I'll test later but this may supersede that PR |
Contributor
|
temporarily merged #5 - will wait until youre done with this, test it and possibly revert if it fixes the same thing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hooks now reload when a .(cade|envrc) file is present in PWD, without needing a PWD change or updated __CADE_LAYERS. It's cached so the stat only runs after a reload.
Otherwise, it's possible for cade to be allowed but not "active" yet, according to the status:
This also fixes an issue where a .envrc file exists but no .cade file meant that cade would not load when allowed (active stays false) even if PWD or __CADE_LAYERS changes.
I've tested it in a couple of shells. I'll test them all and then undraft this.