Skip to content

shells: trigger hook when .(cade|envrc) exists in PWD with cache#8

Draft
plumj-am wants to merge 1 commit into
manic-systems:mainfrom
plumj-am:patch/PlumJam-uyolqrwsxykl
Draft

shells: trigger hook when .(cade|envrc) exists in PWD with cache#8
plumj-am wants to merge 1 commit into
manic-systems:mainfrom
plumj-am:patch/PlumJam-uyolqrwsxykl

Conversation

@plumj-am
Copy link
Copy Markdown
Contributor

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:

 ^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

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.

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>
@atagen
Copy link
Copy Markdown
Contributor

atagen commented May 30, 2026

I suspect this is more elegantly solving some things intended by #5 , I'll test later but this may supersede that PR

@atagen
Copy link
Copy Markdown
Contributor

atagen commented May 31, 2026

temporarily merged #5 - will wait until youre done with this, test it and possibly revert if it fixes the same thing

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

Successfully merging this pull request may close these issues.

2 participants