xtfc / mold

A fresh (ironic? maybe!) approach to project chores.
https://xtfc.org/mold
MIT License
7 stars 0 forks source link

Add a flag to output a source-able environment export #136

Closed scizzorz closed 4 years ago

scizzorz commented 4 years ago

It would be super convenient to have something that would allow a user to activate all of the environment variables defined for a task's execution or something:


$ source <(mold --vars foo)

For example, in this repo:

$ cargo run -- --explain c/build
c/build
Build using cargo
commands:
  $ cargo build
variables:
  $MOLD_ROOT = /home/john/dev/xtfc/mold
  $MOLD_DIR = /home/john/dev/xtfc/mold/.mold
  $MOLD_SOURCE = /home/john/dev/xtfc/mold/.mold/cargo.mold-0.6-00bac035085d4f39
executes:
  $ cargo build

$ cargo run -- --vars c/build
export MOLD_ROOT="/home/john/dev/xtfc/mold"
export MOLD_DIR="/home/john/dev/xtfc/mold/.mold"
export MOLD_SOURCE="/home/john/dev/xtfc/mold/.mold/cargo.mold-0.6-00bac035085d4f39"