Open burke opened 5 years ago
I would start with a simple compiler, we can tackle the monitoring later. SGTM š
Another idea I just had, and maybe the way to start this feature out, is:
shadowenv assimilate --type=dotenv < .env > .shadowenv.d/050-dotenv.lisp
shadowenv assimilate --type=nix-setup-hook < $some_nix_path/nix-support/setup-hook > .shadowenv.d/050-nix-something.lisp
It'd be pretty cool to extract some of this Shadowlisp generation stuff out of dev and directly into Shadowenv.
Is this being worked on and/or urgent? If not, I'd like to give it a stab. I'm still in school, so I think this could be a good motivation when learning about compilers.
Go ahead š
Shadowenv could have a feature to convert other environment manipulation tools' configs to a format it can understand. For example:
This is obviously the most trivial case, but we could do similar things for:
.envrc
.ruby-version
Because of Shadowenv's lack of ability to do much of anything dynamic at load-time, this would essentially function as a "compiler" for these environment files.
One trick to try to make these files at least marginally portable would be to replace the user's home directory in any outputs with
(concat (env/get "HOME") ...)
.If we wanted to keep tabs on a mapping between the original and the assimilated version, we could encode a checksum/hash of the source file in the assimilated file as a comment on the first line. With this, shadowenv or dev could potentially observe these files when entering a directory and inform the user about out-of-date-ness.