corbindavenport / nexus-tools

Installer for ADB, Fastboot, and other Android tools on Linux, macOS, Chrome OS, and Windows
http://forum.xda-developers.com/general/general/tool-nexus-tools-2-8-featured-xda-t3258661
GNU General Public License v3.0
844 stars 86 forks source link

BUG: Missing to handle the absence of $HOME/.bashrc or $HOME/.zshrc #52

Closed GV3 closed 3 years ago

GV3 commented 3 years ago

The PATH is was not added when I run the install.

After noticing that the Nexus tools directory was not in the PATH, I reviewed the install.sh document and I noticed that the code does not cover handle the absence of $HOME/.bashrc or $HOME/.zshrc. (As you can imagine by now I'm running a UNIX system, a Mac) :)

Have you considered adding also support for ~/.bash_profile? 👍

Here are the lines of code mentioned above:

install.sh:64

# Nexus Tools directory needs to be added to $PATH
        if [ -f "$HOME/.bashrc" ]; then
            echo 'export PATH=$PATH:'$DIR >> $HOME/.bashrc
            source "$HOME/.bashrc"
            echo "[ OK ] Added $DIR/ to $HOME/.bashrc."
        fi
        if [ -f "$HOME/.zshrc" ]; then
            echo 'export PATH=$PATH:'$DIR >> $HOME/.zshrc
            source "$HOME/.zshrc"
            echo "[ OK ] Added $DIR/ to $HOME/.zshrc."
        fi
corbindavenport commented 3 years ago

Ahh, this might explain a Twitter message I got recently where someone with a Mac was having issues. I'll get a fix integrated soon.

corbindavenport commented 3 years ago

This is now fixed with v4.4: https://github.com/corbindavenport/nexus-tools/releases/tag/4.4

Thanks for reporting!