Closed Cliabhach closed 5 years ago
The difference is only that the former is truthy for an empty string and the latter is not. It's a shorthand to check if a variable is set, allowing for it to be set but empty.
empty=""
[[ -n "${empty+1}" ]] && echo "true" || echo "false"
# >> true
[[ -n "${empty}" ]] && echo "true" || echo "false"
# >> false
Ah, I see. If it's an empty string, the script skips the installation request and goes straight on to the invocation(s) of generate_for_language()
. Thanks for explaining!
I noticed that line 5 of https://github.com/square/connect-api-specification/blob/10b866c654/generate-sdks uses an unusual form of parameter expansion:
I had trouble finding documentation on what the
+
syntax means. Is there any practical difference between that and the below?