Skip to content

Commit c9c934b

Browse files
authored
Update delete.py
1 parent 1e5dd29 commit c9c934b

File tree

1 file changed

+1
-45
lines changed

1 file changed

+1
-45
lines changed

github_deploy/commands/delete.py

Lines changed: 1 addition & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -5,51 +5,7 @@
55

66
from github_deploy.commands._constants import BASE_URL
77
from github_deploy.commands._http_utils import delete, get, list_repos
8-
from github_deploy.commands._utils import get_repo
9-
10-
11-
async def delete_content(
12-
*,
13-
session,
14-
repo,
15-
dest,
16-
token,
17-
semaphore,
18-
exists,
19-
current_sha,
20-
):
21-
headers = {
22-
"Authorization": "token {token}".format(token=token),
23-
"Accept": "application/vnd.github.v3+json",
24-
}
25-
26-
data = {"message": "Deleted {}".format(dest)}
27-
if exists:
28-
data["sha"] = current_sha
29-
30-
url = BASE_URL.format(repo=repo, path=dest)
31-
32-
async with semaphore:
33-
response = await delete(
34-
session=session, url=url, data=data, headers=headers
35-
)
36-
37-
return response
38-
39-
40-
async def check_exists(*, session, repo, dest, token, semaphore, skip_missing):
41-
headers = {"Authorization": "token {token}".format(token=token)}
42-
url = BASE_URL.format(repo=repo, path=dest)
43-
44-
async with semaphore:
45-
response = await get(
46-
session=session,
47-
url=url,
48-
headers=headers,
49-
skip_missing=skip_missing,
50-
)
51-
52-
return response
8+
from github_deploy.commands._utils import get_repo, delete_contents, check_exists
539

5410

5511
async def handle_file_delete(*, repo, dest, token, semaphore, session):

0 commit comments

Comments
 (0)