Skip to content

Proposal: shadowenv assimilate #52

@burke

Description

@burke

Shadowenv could have a feature to convert other environment manipulation tools' configs to a format it can understand. For example:

# .env
A=b
$ shadowenv assimilate
assimilated .env as .shadowenv.d/050-dotenv.lisp
; 050-dotenv.lisp
(env/set "A" "b")

This is obviously the most trivial case, but we could do similar things for:

  • .envrc
  • .ruby-version
  • and so on.

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions