You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Force magic to reload the file .tea.yaml on git hook post-checkout #20
I want to force magic to reload the .tea.yaml on the git hook post-checkout, to ensure the I'm using the correct version of each tool mentioned in the .tea.yaml.
Doing cd . in the terminal works, but not on the Makefile, nor on a script file.
Is there any way to force maging to reload the .tea.yaml?
oh actually the magic actually executes: source <(tea +tea.xyz/magic -Esk --chaste env) if you want to be completely correct. This adds the TEA_REWIND env to ensure the env can be undone.
-k for keep going so it doesn't fail in directories that have no env, --chaste to prevent it downloading packages, -s for silent.
I'm in the process of standardzing this weird-ass command to something more normal.
I also tried to run eval "$(tea +tea.xyz/magic -Esk --chaste env)" or bash -c "source <(tea +tea.xyz/magic -Esk --chaste env)" from the Makefile, to it has no effect.
/bin/sh is bash v3 on macOS which cannot handle that syntax. You can use eval "$(tea stuff)" instead.
v1 has changed things, dev will work in the terminal, but not in a Makefile. This should be fixed, and we will do so. In the meantime for a Makefile you can use tea as a runner eg. tea node@20.1. Not ideal in that you have to repeat version info, but it'll work for now.
edit: apologies for the late response, I've been preparing tea 1.0 release for weeks!
Activity
mxcl commentedon Jul 31, 2023
source <(tea -E)or equivalent for your shell, I think the best way with bash iseval "$(tea -E)"mxcl commentedon Jul 31, 2023
nice trick too, we should document this.
oh actually the magic actually executes:
source <(tea +tea.xyz/magic -Esk --chaste env)if you want to be completely correct. This adds theTEA_REWINDenv to ensure the env can be undone.-kfor keep going so it doesn't fail in directories that have no env,--chasteto prevent it downloading packages,-sfor silent.I'm in the process of standardzing this weird-ass command to something more normal.
4brunu commentedon Jul 31, 2023
Hi, thanks for the quick answer.
I'm using
zshon macOS.source <(tea +tea.xyz/magic -Esk --chaste env)works on the terminal, but fails on the Makefile with the following error:source <(tea -E)has the same error on the Makefile.eval "$(tea -E)"has no effect on the Makefile.4brunu commentedon Aug 1, 2023
I also tried to run
eval "$(tea +tea.xyz/magic -Esk --chaste env)"orbash -c "source <(tea +tea.xyz/magic -Esk --chaste env)"from the Makefile, to it has no effect.mxcl commentedon Sep 11, 2023
/bin/shisbashv3 on macOS which cannot handle that syntax. You can useeval "$(tea stuff)"instead.v1 has changed things,
devwill work in the terminal, but not in aMakefile. This should be fixed, and we will do so. In the meantime for a Makefile you can useteaas a runner eg.tea node@20.1. Not ideal in that you have to repeat version info, but it'll work for now.edit: apologies for the late response, I've been preparing tea 1.0 release for weeks!
4brunu commentedon Sep 11, 2023
Hey, thanks for the response and for the work on tea 1.0.
Can we keep this issue open, while
tea/magicdoesn't support this use case in theMakefile?