How does one consume the output of a `shell_comman...
# general
r
How does one consume the output of a
shell_command
. The docs don't have an example. Is the
name
attributed omitted on purposed? https://www.pantsbuild.org/stable/docs/shell/run-shell-commands
1
I am trying to bundle a generated resource into a Pex Binary.
Copy code
python_sources(name="lib")

shell_command(
    name="echo_txt",
    command="echo hello world > in.txt",
    tools=["echo"],
    output_files=["in.txt"],
)

resources(
    name="txt",
    sources=["in.txt"],
    dependencies=[":echo_txt"],
)

pex_binary(
    name="app",
    entry_point="main.py",
    dependencies=[":lib", ":txt"],
w
I vaguely remember doing this as an example for some other slack thread. Maybe there’s some information you can glean from this? https://github.com/sureshjoshi/pants-shell-command-example/blob/main/src/BUILD.pants
r
I see so you used ‘experimental_wrapped_as_resource’. Thanks I will try it out and get back to you.
w
👍
r
Worked. Thanks. However, it feels to me like
resources
should work without the need to use
experimentas_wrapped_as_resource
. Who is the right person to escalate to do you know? I can maybe even help a bit if possible.
w
Well, you could start by creating a github ticket or discussion with what you think the "correct" functionality should look like, and either look for feedback on it, or take a crack at it
👍 1