Avoid adding modified PATH to multiple shell config files
userpath.append() seems to write the modified PATH to all available shell configuration files currently. Example:
$ mkdir temp/ && userpath append -s bash temp/
$ tail -n 2 .bashrc && tail -n 2 .profile
# Created by `userpath` on 2023-06-18 13:18:55
export PATH="$PATH:/home/user/temp"
# Created by `userpath` on 2023-06-18 13:18:55
export PATH="$PATH:/home/user/temp"
I'd think there should be an option to turn that off. Or is there?
This code seems to be responsible for the behaviour:
https://github.com/ofek/userpath/blob/9b475a5311d077d36495f6afbeeee6201892ddbc/userpath/interface.py#L133-L134
@ofek Would you be interested in such a feature (maybe through a command line option)? If so, I'd be happy to contribute.
I would very much appreciate that! I think maybe what you're talking about should be the default behavior, see this issue https://github.com/ofek/userpath/issues/3#issuecomment-512973913
Could you state your preference, then? Only adding to shell login file, or a CLI option like --file and environment variable, or both?
Preferably both but the former for sure, just modify one file by default
Hrm, and then #48 was reverted?!?