Skip to content

Commit 9997cc0

Browse files
committed
Delete fork on download if exists
1 parent eb26cfc commit 9997cc0

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

app/commands/download.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
from app.utils.click import error, info, success, warn
1414
from app.utils.gh_cli import (
1515
clone_with_custom_name,
16+
delete_repo,
1617
fork,
1718
get_username,
1819
has_fork,
@@ -53,10 +54,10 @@ def setup_exercise_folder(
5354
info("Checking if you already have a fork")
5455
fork_name = config.exercise_fork_name(username)
5556
if has_fork(fork_name, verbose):
56-
info("You already have a fork")
57-
else:
58-
warn("You don't have a fork yet, creating one")
59-
fork(exercise_repo, fork_name, verbose)
57+
info("You already have a fork, deleting it")
58+
delete_repo(fork_name, verbose)
59+
info("Creating fork of exercise repository")
60+
fork(exercise_repo, fork_name, verbose)
6061
info("Creating clone of your fork")
6162
clone_with_custom_name(
6263
f"{username}/{fork_name}", config.exercise_repo.repo_name, verbose

0 commit comments

Comments
 (0)