debian-mirror-gitlab/workhorse-vendor/github.com/certifi/gocertifi/tasks.py

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

21 lines
410 B
Python
Raw Normal View History

2021-04-17 20:07:23 +05:30
from invoke import task
import requests
@task
def update(ctx):
r = requests.get('https://mkcert.org/generate/')
r.raise_for_status()
certs = r.content
with open('certifi.go', 'rb') as f:
file = f.read()
file = file.split('`\n')
assert len(file) == 3
file[1] = certs
ctx.run("rm certifi.go")
with open('certifi.go', 'wb') as f:
f.write('`\n'.join(file))