import json, sys, os
d = json.load(sys.stdin)['assets']
for a in d:
    if a['name'] == sys.argv[1] + '.tar.gz':
        os.system('curl -u yihui:' + os.getenv('GH_TOKEN') + ' -X DELETE ' + a['url'])

import json, sys, os
d = json.load(sys.stdin)['assets']
for a in d:
    if a['name'].startwith(sys.argv[1]):
        os.system('curl -u yihui:' + os.getenv('GH_TOKEN') + ' -X DELETE ' + a['url'])

delete all assets that start with the argument, e.g. python delete.py texlive will delete both texlive.tar.gz and texlive-local.deb