Last active
January 19, 2022 15:25
-
-
Save DrizzlyOwl/a27aeebfa7e66d8ec806220b91231100 to your computer and use it in GitHub Desktop.
Parse composer outdated into a markdown table
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json,sys; | |
a = json.load(sys.stdin); | |
packages = a['installed']; | |
num_packages = len(packages); | |
are_available_updates = bool(num_packages); | |
if are_available_updates: | |
print("There are "+str(num_packages)+" package updates available"); | |
print("\n"); | |
print("|Name|Version|Latest|"); | |
print("|---|---|---|"); | |
for x in packages: | |
print("|"+x['name']+"|"+x['version']+"|"+x['latest']+"|"); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment