Welcome to mirror list, hosted at ThFree Co, Russian Federation.

tasks.py « gocertifi « certifi « github.com « vendor - gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 7616f3a6ac334e785f0d33b260424f88e086cd51 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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))