Skip to content

Instantly share code, notes, and snippets.

@shuuji3
Last active November 3, 2021 08:16
Show Gist options
  • Save shuuji3/12a65d5f56f7fade617a06f5467dcc85 to your computer and use it in GitHub Desktop.
Save shuuji3/12a65d5f56f7fade617a06f5467dcc85 to your computer and use it in GitHub Desktop.
Temporary solution for `mas list --json`. ref. Add option for retrieving information in JSON format · Issue #190 · mas-cli/mas - https://github.com/mas-cli/mas/issues/190
{"id": 497799835, "name": "Xcode (13.1)"}
{"id": 1423210932, "name": "Flow (2.7.5)"}
{"id": 1452453066, "name": "Hidden Bar (1.8)"}
{"id": 1475387142, "name": "Tailscale (1.16.1)"}
for i in (mas list)
echo $i | python -c "import re; print(re.sub(r'(\d+)\s+(.+?)\s+(\(.+\))', r'{\"id\": \1, \"name\": \"\2 \3\"}', input()))"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment