Is there a way to tell pants to run a target befor...
# general
a
Is there a way to tell pants to run a target before all other targets, without having to add it as a dependency?
b
Not really. To avoid an “x-y problem”, can you provide a bit more context about the underlying task you’re trying to achieve?
a
Yes, and sorry for the x-y trap 🤣 . I have a target
:auth
that runs a shell command that updates the auth token for my remote cache (buildbarn). I would like to default to running that each time before other targets, to ensure the auth token is up to date. I thought about various ways to achieve this: 1. Use a Makefile, makes handling dependency easy, but requires writing makefile targets for each pants command I want to run 2. Alias pants to something like
./get_token.sh && pants
. Easy enough but each developer has to set this 3. Do something else in pants if possible
b
Ah, okay! I think this is possible, via `.pants.bootstrap`: https://www.pantsbuild.org/2.20/docs/using-pants/key-concepts/options#pantsbootstrap-file
a
That looks what I want. Thanks!!
f
@broad-processor-92400 this is very nice that I've added this section to the docs, users asked about this at least 3 times in the past few weeks. Thanks for the reviews, as always 💗
👏 1
👍 1