https://pantsbuild.org/ logo
#general
Title
# general
g

gifted-agency-25998

12/07/2022, 3:30 PM
Hi all, with
pants
being installed in the root of the repo, I find it a little more effort to go to the repo root before running it (or having to count the number
../
I need to do) Is there some way to be able to call pants from any subdirectory of the repo?
1
l

lemon-oxygen-72498

12/07/2022, 3:43 PM
You could use direnv to augment your shell when you enter the repo. You would do this with a
.envrc
containing
PATH_add $(pwd)
(doc). That would add the
pants
script to your
$PATH
when you are in your repo.
g

gifted-agency-25998

12/07/2022, 3:49 PM
Fantastic! Thank you 😄
🙇 1
c

curved-television-6568

12/07/2022, 4:07 PM
beware though that any specs passed as arguments to pants would still likely need to be relative to the project root rather than your cwd..
g

gifted-agency-25998

12/07/2022, 4:08 PM
good point - thanks 🙂 I'll make a note of that 🙂
r

refined-addition-53644

12/07/2022, 4:17 PM
👀 1
g

gifted-agency-25998

12/07/2022, 4:35 PM
Thanks -
p
looks great - will try that out too 🙂
5 Views