$ op run --env-file=$HOME/.config/op/aws/$AWS_PROFILE -- jhdev docker ecr-login
[ERROR] 2022/07/07 13:32:00 error while starting process: exec: "jhdev": executable file not found in $PATH
Any fix or workaround for this I'm missing?
1Password Version: 8.7.3
Extension Version: n/a
OS Version: macOS 12.4
Browser:_ n/a
Referrer: forum-search:op run file not found
Comments
Team Member
Hey @jhellma1 ,
Thank you for reaching out to us!
I think there are a couple of issues here:
op run
doesn't delegate calling commands to a shell, but calls the commands itself, hence it doesn't have the context of functions/aliases defined in the calling shell's profileop run -- $SHELL -c <their command>
(which circumvents the problem above) , shell functions are not exported to subshells, since, in general, they aren't meant to be used like thisHowever, in bash, there's a workaround for this, since functions can actually be exported.
Here's a toy example of how this would work:
Let us know if this helps. Looking forward to hearing from you!
Best,
Horia
Hello Horia, this was very helpful and I'm all good now, thanks!
Team Member
Glad to have sorted it out! Let us know if we can be of help with anything else.
Best,
Horia