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

Incorrect logic on ARCH check #50

Closed nwithan8 closed 4 years ago

nwithan8 commented 4 years ago

Seems you need to use = rather than == on line 146. Testing example below (done on an x86_64 machine; uname -m prints out "x86_64")

$ if [ $(uname -m) = 'x86_64' ] ; then
> echo 'True'
> fi
True
$ if [ $(uname -m) == 'x86_64' ] ; then
> echo 'True'
> fi
sh: 4: [: x86_64: unexpected operator
$ if [ "$(uname -m)" == "x86_64" ] ; then
> echo "True"
> fi
sh: 7: [: x86_64: unexpected operator
$ if [ "$(uname -m)" = "x86_64" ] ; then
> echo "True"
> fi
True
corbindavenport commented 4 years ago

Ah, I didn't realize == was non-standard: https://stackoverflow.com/a/2237103

Thanks for flagging! I've fixed the script.