Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Construct ZIP files while uploading executables. #2139

Merged
merged 2 commits into from
Sep 3, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions misc-tools/configure-domjudge.in
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import json
import os.path
import requests
import requests.utils
import shutil
import sys
from typing import List, Set

Expand Down Expand Up @@ -101,11 +102,16 @@ else:
if os.path.exists('executables'):
executables = []
for file in os.listdir('executables'):
if file.endswith(".zip"):
executables.append(file[:-4])
if executables and dj_utils.confirm('Upload language executables (found: ' + ','.join(executables) + ')?', False):
if os.path.isdir(f'executables/{file}'):
executables.append(file)
shutil.make_archive(f'executables/{file}', 'zip', f'executables/{file}')

if executables:
if dj_utils.confirm('Upload language executables (found: ' + ','.join(executables) + ')?', False):
for langid in executables:
dj_utils.upload_file(f'languages/{langid}/executable', 'executable', f'executables/{langid}.zip')
for langid in executables:
dj_utils.upload_file(f'languages/{langid}/executable', 'executable', f'executables/{langid}.zip')
os.remove(f'executables/{langid}.zip')


if os.path.exists('languages.json'):
Expand Down
Loading