Skip to content

Commit

Permalink
fetch-configlet: improve style slightly (#322)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
ee7 authored May 11, 2021
1 parent 214172f commit 3b4b009
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/fetch-configlet
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3b4b009

Please sign in to comment.