Closed aparajita closed 11 months ago
Hi @aparajita. As integers are valid JSON data types, then this is actually intended behaviour. Consider the following example:
$ VERSION=$(app-store-connect get-latest-testflight-build-number 1550275619 | jq)
Found build number 10 from TestFlight version 1.0.2
$ echo $VERSION
10
Note informative log lines are written to STDERR stream (by default) and are not captured by piping or variable initialization unless stream redirection is used.
All in all, in case of integer versions there is no difference in JSON and regular output.
Actually, on a second thought, there seems to be a bug indeed. As version
attribute of PreReleaseVersion
and versionString
attribute of AppStoreVersion
are both strings, then using --json
flag should wrap the version in quotes. And in case the build number is not a number, which is completely valid case, then this cannot be piped to JSON parser, say jq
, at all as of now:
$ app-store-connect get-latest-testflight-build-number 1481211155 | jq
Found build number 2.0.335.528 from TestFlight version 2.0.335
parse error: Invalid numeric literal at line 2, column 0
Found build number 10 from TestFlight version 1.0.2
Since the tool obviously figures out the version, I was hoping (and kind of expecting) the json output would be like this:
{
"version": "1.0.2",
"build": "10"
}
Unless I'm missing something, otherwise to get the corresponding app version we have to explicitly go through the several steps you go through internally to get it.
Would it be possible to add an --include-version
option (or something like that) to return the JSON outlined above?
Since altering the default behaviour of what --json
does would be breaking for existing users, we cannot always include the version info in the output. However, I don't see a reason why this specific action and other similar ones (get-latest-build-number
and get-latest-app-store-build-number
) couldn't output both version and build number as proposed when additional flag is passed.
Since altering the default behaviour of what
--json
does would be breaking for existing users
That's why I proposed a new flag. 😁
@aparajita This feature is now released and is available in version 0.45.0. More details can be seen from the description of PR #349. Example usages can be seen from this screenshot:
These are awesome tools, thank you so much!
The
--json
argument is not working for me. For example:Returns:
Am I doing something wrong, or is this a known bug?