gnachman / iterm2-website

Website for iTerm2
http://iterm2.com/
GNU General Public License v2.0
81 stars 65 forks source link

For shell equality tests, use '=' instead of '==' #33

Closed DimitryAndric closed 8 years ago

DimitryAndric commented 8 years ago

Using '==' is a bashism, so running install_shell_integration.sh or install_shell_integration_and_utilities.sh with zsh gives a rather confusing error message:

% zsh ./install_shell_integration_and_utilities.sh
./install_shell_integration_and_utilities.sh:15: = not found

Using a single '=' to test for equality is more portable, so use that instead.

gnachman commented 8 years ago

These are bash scripts, though.

#!/bin/bash

Why would you run it through zsh? I don't want the risk of a change unless it's for a good enough reason.

DimitryAndric commented 8 years ago

Oh, I simply assumed you could curl these scripts and run them through whatever your current shell is. It appeared the scripts were written in mostly cross-compatible sh, so I simply ran zsh ./install_shell_integration_and_utilities.sh, and got that error.

If you prefer to change these as little as possible, I understand. But in both bash and zsh, the official equality operator for the test/[ command is really a single=. So this is a pretty low risk change, with an admittedly very small benefit. :)

gnachman commented 8 years ago

Yeah, you're right. == isn't even documented. This should be safe to pull. Thanks!