change rm dir to only delete the repo folder

This commit is contained in:
Enzo Nunes
2025-02-23 23:27:19 +00:00
parent 93de71623f
commit 252bd31e8b

View File

@@ -40,6 +40,7 @@ def get_commits_last_30_days(owner, repo, token):
def get_lines_of_code(owner, repo):
repo_url = f"https://github.com/{owner}/{repo}.git"
clone_dir = os.path.expanduser("~/temp/PICable")
rm_dir = os.path.expanduser(f"~/temp/PICable/{repo}")
try:
subprocess.run(["git", "clone", repo_url, clone_dir], check=True, stdout=sys.stdout, stderr=sys.stderr)
@@ -53,7 +54,7 @@ def get_lines_of_code(owner, repo):
break
else:
loc = 0
subprocess.run(["rm", "-rf", clone_dir], check=True)
subprocess.run(["rm", "-rf", rm_dir], check=True)
return loc