Don't edit my `.bashrc`
Describe the bug The module silently adds ...
export OP_ACCOUNT="<ACCOUNT>.1password.com"
to my .bashrc.
To Reproduce Steps to reproduce the behavior:
The-Matrix$ tail -2 ~/.bashrc
. "$HOME/.local/bin/env"
export alpha=beta
The-Matrix$ cat r.py
#!/usr/bin/env python3
from onepassword import OnePassword
op = OnePassword()
The-Matrix$ ./r.py
Please input your 1Password personal or business acount name e.g. company from company.1password.com: my.1password.com
The-Matrix$ tail -2 ~/.bashrc
export alpha=beta
export OP_ACCOUNT="my.1password.com"
Expected behavior It should not do that!
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
- OS: MacOS
- Version 15.3.1
Additional context
For someone who is working with multiple 1Password accounts, this causes unexpected bevhaviours, but you should not touch my .bashrc, and never do something like that silently.
I think it's a very fair point and the best we could do is add some logging to tell users it's happening. However if we didn't add that line to the bashrc the integration between the op cli and python kernel wouldn't work which is the whole purpose of this library. This is how sessions are upheld in the cli and python os environment is not great at maintaining that.
Would that extra notification be better for now?
@dtpryce Unfortunately this means this library is unusable in a Nix-setting. My .zshrc is a read-only file since I'm using NixOs which causes this library to crash.