Skip to content

Command to print all PATH information that can be consumed by the shell #620

Closed
@lostman

Description

@lostman

OCaml's opam has a convenient command to setup environment variables:

❯ opam config env
CAML_LD_LIBRARY_PATH="/Users/lostman/.opam/system/lib/stublibs:/usr/local/lib/ocaml/stublibs"; export CAML_LD_LIBRARY_PATH;
OPAMUTF8MSGS="1"; export OPAMUTF8MSGS;
MANPATH=":/Users/lostman/.opam/system/man"; export MANPATH;
MAKELEVEL=""; export MAKELEVEL;
MAKEFLAGS=""; export MAKEFLAGS;
PERL5LIB="/Users/lostman/.opam/system/lib/perl5"; export PERL5LIB;
OCAML_TOPLEVEL_PATH="/Users/lostman/.opam/system/lib/toplevel"; export OCAML_TOPLEVEL_PATH;
PATH="/Users/lostman/.opam/system/bin:/Users/lostman/.local/bin:/Users/lostman/.cabal/bin:/Users/lostman/bin:/usr/local/Cellar/llvm/3.4.2/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/opt/X11/bin"; export PATH;

Which can be consumed by:

eval `opam config env`

It would be great if stack offered something similar. In particular, when using stack-installed GHC one needs to add it to PATH. Ditto regarding bin/ directory. While stack exec foo works, it is not enough when I want to call more than one binary from a script.

stack config env (or equivalent) could work globally by pointing to the latest GHC version that has been installed and locally in a directory with stack.yaml by pointing to GHC version that is required to build that particular project.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions