1P Zsh plugins no loading for shell script
Is there a documented way to make sure the 1P plugins load when invoking a shell script?
I use Zsh and have
sourced the plugins on shell load such that this works fine in an interactive window:
$ which aws aws: aliased to op plugin run -- aws $ aws s3 ls # prompts for access and lists S3 buckets
However, when I write a script to do it:
echo "Shell: $SHELL" echo "AWS: $(which aws)"
and execute it:
$ ./myscript.sh Shell: /bin/zsh AWS: /opt/homebrew/bin/aws
it doesn't seem to be picking up my plugins despite running within the Zsh shell and therefore can't authenticate.
I'm sure this is something I'm misunderstanding about the environment in which the shell is running. Any tips?