-
Hello, I have a 3rd party tool which only respects the tldr:
Interestingly this works using this example
notice the "single case switch". And it works as I would like
Both use cases are covered ✅ But when I try to simplify the poe configuration using this
it does not work.
Notice the empty Any tips how to use the simplified version ? Or it has something to do with subprocesses and passing env variables and it cannot be easily achieved otherwise ? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @pklejch, I just got around to looking at this properly and now I see that I misunderstood your problem the first time, so I deleted my original answer. I understand you want your task to set AWS_PROFILE based on the However, since arg values are actually set as environment variables, you can still get what you what simply by renaming the arg like so: [tool.poe.tasks.my_task]
cmd = 'echo "Running with profile: ${AWS_PROFILE}"'
args = [{ name = "AWS_PROFILE", options = ["--profile"], default = "${AWS_PROFILE}" }] |
Beta Was this translation helpful? Give feedback.
Hi @pklejch, I just got around to looking at this properly and now I see that I misunderstood your problem the first time, so I deleted my original answer.
I understand you want your task to set AWS_PROFILE based on the
--profile
arg with a fallback to inheriting it from the environment. The approach is reasonable doesn't work because as it happens poe resolves the env for the task from other options before parsing the task arguments (so a CLI argument could have a default value based on the env task option, but not vice versa).However, since arg values are actually set as environment variables, you can still get what you what simply by renaming the arg like so: