Skip to content

Commit 3b4b009

Browse files
authored
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
1 parent 214172f commit 3b4b009

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scripts/fetch-configlet

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ get_download_url() {
4949
cut -d'"' -f4
5050
}
5151

52-
main () {
52+
main() {
5353
if [[ -d ./bin ]]; then
5454
output_dir="./bin"
55-
elif [[ $PWD = */bin ]]; then
55+
elif [[ $PWD == */bin ]]; then
5656
output_dir="$PWD"
5757
else
5858
echo "Error: no ./bin directory found. This script should be ran from a repo root." >&2

0 commit comments

Comments
 (0)