Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion build/scripts/find-lint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ if [ ${1:-""} = "fast" ]
then args="--fast"
fi

if [[ -v COMPLEMENT_LINT_CONCURRENCY ]]; then
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The -v thing seems to only work on bash 4.2 and above, https://unix.stackexchange.com/a/212192/52320

On macOS 11.1

bash --version
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin20)
Copyright (C) 2007 Free Software Foundation, Inc.

if [ -z ${COMPLEMENT_LINT_CONCURRENCY+x} ]; then
Copy link
Copy Markdown
Collaborator Author

@MadLittleMods MadLittleMods Feb 22, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of using the empty if-case, I tried using -n but it doesn't seem to behave the same as the -z and else

-n
string is not null.

-z
string is null, that is, has zero length

https://unix.stackexchange.com/a/109631/52320

if [ -n ${COMPLEMENT_LINT_CONCURRENCY+x} ]; then
$ ./build/scripts/find-lint.sh
./build/scripts/find-lint.sh: line 23: COMPLEMENT_LINT_CONCURRENCY: unbound variable

$ COMPLEMENT_LINT_CONCURRENCY=1 ./build/scripts/find-lint.sh
No issues found :)

# COMPLEMENT_LINT_CONCURRENCY was not set
:
else
args="${args} --concurrency $COMPLEMENT_LINT_CONCURRENCY"
fi

Expand Down