forked from CTFd/CTFd
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
9 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,16 @@ | ||
""" | ||
python import.py export.zip challenges,teams,both,metadata | ||
""" | ||
from CTFd import create_app | ||
from CTFd.utils import import_ctf | ||
|
||
import zipfile | ||
import sys | ||
|
||
app = create_app() | ||
with app.app_context(): | ||
import_ctf(sys.argv[1]) | ||
if sys.argv[2]: | ||
segments = sys.argv[2].split(',') | ||
else: | ||
segments = None | ||
|
||
import_ctf(sys.argv[1], segments=segments) |