<#18335 run_shell_command workdir='.' appears igno...
# github-notifications
c
#18335 run_shell_command workdir='.' appears ignored Issue created by cburroughs Describe the bug I would expect that if I set
Copy code
run_shell_command(
    name='where-am-i-workdir',
    command="pwd",
    workdir='.'
)
Then the command to run relative to the BUILD file ("`.` specifies the location of the
BUILD
file.") However,
Copy code
$ cat src/py/example/BUILD  | head -18
run_shell_command(
    name='where-am-i',
    command="pwd",
)
    
run_shell_command(
    name='where-am-i-workdir',
    command="pwd",
    workdir='.'
)

run_shell_command(
    name='where-am-i-workdir-2',
    command="cd {chroot} && pwd",
    workdir='.'
)
Copy code
$ ./pants run src/py/example:where-am-i-workdir
/home/ecsb/src/o/example-python

$ ./pants run src/py/example:where-am-i-workdir-2
/tmp/pants-sandbox-7zAQyl
Neither of which are the "same" (in or out of the sandbox) directory as the BUILD file. Pants version 2.16.0.dev7 OS Linux Additional info cburroughs/example-python@e27998a A less contrived pseudo-code example of what I'm trying to do:
Copy code
run_shell_command(
    command="./src.py.example/foo-cli.pex --do-stuff-to-files=my-file.txt",
    execution_dependencies=['src/py/example/foo-cli.pex', ':my-text-files'],
    workdir='.'
pantsbuild/pants