Force magic to reload the file `.tea.yaml` on git hook `post-checkout`
Hi,
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?
Thanks
source <(tea -E) or equivalent for your shell, I think the best way with bash is eval "$(tea -E)"
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 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.
Hi, thanks for the quick answer.
I'm using zsh on macOS.
source <(tea +tea.xyz/magic -Esk --chaste env) works on the terminal, but fails on the Makefile with the following error:
source <(tea +tea.xyz/magic -Esk --chaste env)
/bin/sh: -c: line 0: syntax error near unexpected token `('
/bin/sh: -c: line 0: `source <(tea +tea.xyz/magic -Esk --chaste env)'
source <(tea -E) has the same error on the Makefile.
eval "$(tea -E)" has no effect on the Makefile.
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 [email protected]. 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!
Hey, thanks for the response and for the work on tea 1.0.
Can we keep this issue open, while tea/magic doesn't support this use case in the Makefile?