profile/bash_profile means use whichever file already exists, defaulting to bash_profile
I dispensed with checking if we're on the ubuntu distro (and the distro dependency) in favor of just noting which of ~/.profile and/or ~/.bash_profile exist. I pick one, and only upgrade ~/.profile if it is the only one that currently exists in a user's home directory.
I wasn't able to get the tests working in my local computer (possibly because I'm on macOS) so hopefully on a pull request the CI will test this code.
This my attempt to fix #19
The logic here is attempting to code @AlJohri's mention of what files to modify from https://github.com/ofek/userpath/issues/3#issuecomment-512973913, specifically:
I dispensed with checking if we're on the ubuntu distro (and the
distro
dependency) in favor of just noting which of~/.profile
and/or~/.bash_profile
exist. I pick one, and only upgrade~/.profile
if it is the only one that currently exists in a user's home directory.I wasn't able to get the tests working in my local computer (possibly because I'm on macOS) so hopefully on a pull request the CI will test this code.