Giter VIP home page Giter VIP logo

Comments (3)

astoff avatar astoff commented on July 17, 2024

Ah, okay, I'll fix this.

Now, I wanted to ask your opinion. I'm considering adding this defvar to allow handling some script names in a special way.

(defvar buffer-env--commands
  '((t . ">&2 . \"$0\" && env -0")
    (".env" . "set -a && >&2 . \"$0\" && env -0")
    ("guix.scm" . ">&2 guix shell -D -f \"$0\" -- env -0"))
  "Alist of commands used to produce environment variables.
For each entry, the car is possible value of
`buffer-env-script-name' and the cdr is a shell command.  When a
script is found, the corresponding command is executed in a
shell, in the directory of the script, with its absolute file
name as argument.  The command should print a null-separated list
of environment variables, and nothing else, to the standard
output.

The entry t in this alist is a fallback value.")

So in your use-case, you could add (".envrc" . "direnv exec . env -0") to this list. I guess this would help in your use-case, right?

On the other hand, I should ask: why not just put source env/bin/activate in a .envrc file?

from buffer-env.

manuel-uberti avatar manuel-uberti commented on July 17, 2024

I like the idea of the defvar, although I'd probably make it a defcustom since the user can change its value.

On the other hand, I should ask: why not just put source env/bin/activate in a .envrc file?

No specific reason. I didn't want to rely on direnv on this project because I like the fact that buffer-env does not force me to. :)

from buffer-env.

manuel-uberti avatar manuel-uberti commented on July 17, 2024

Thank you, I confirm it's working as expected now.

from buffer-env.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.