From 3b4b00983ac6950c08658d8b84099bf6f6066fc2 Mon Sep 17 00:00:00 2001 From: ee7 <45465154+ee7@users.noreply.github.com> Date: Tue, 11 May 2021 09:43:03 +0200 Subject: [PATCH] fetch-configlet: improve style slightly (#322) This commit applies a preference for `==` over `=` when using `[[`. From Google's Shell Style Guide [1]: > For clarity, use `==` for equality rather than `=` even though both > work. The former encourages the use of `[[` and the latter can be > confused with an assignment. We also remove the space before a function's parentheses to be more consistent with the style of our other function, `get_download_url()` [1] https://google.github.io/styleguide/shellguide.html#testing-strings --- scripts/fetch-configlet | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/fetch-configlet b/scripts/fetch-configlet index 46e59cd3..827088ab 100755 --- a/scripts/fetch-configlet +++ b/scripts/fetch-configlet @@ -49,10 +49,10 @@ get_download_url() { cut -d'"' -f4 } -main () { +main() { if [[ -d ./bin ]]; then output_dir="./bin" - elif [[ $PWD = */bin ]]; then + elif [[ $PWD == */bin ]]; then output_dir="$PWD" else echo "Error: no ./bin directory found. This script should be ran from a repo root." >&2