change rm dir to only delete the repo folder
This commit is contained in:
@@ -40,6 +40,7 @@ def get_commits_last_30_days(owner, repo, token):
|
|||||||
def get_lines_of_code(owner, repo):
|
def get_lines_of_code(owner, repo):
|
||||||
repo_url = f"https://github.com/{owner}/{repo}.git"
|
repo_url = f"https://github.com/{owner}/{repo}.git"
|
||||||
clone_dir = os.path.expanduser("~/temp/PICable")
|
clone_dir = os.path.expanduser("~/temp/PICable")
|
||||||
|
rm_dir = os.path.expanduser(f"~/temp/PICable/{repo}")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
subprocess.run(["git", "clone", repo_url, clone_dir], check=True, stdout=sys.stdout, stderr=sys.stderr)
|
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
|
break
|
||||||
else:
|
else:
|
||||||
loc = 0
|
loc = 0
|
||||||
subprocess.run(["rm", "-rf", clone_dir], check=True)
|
subprocess.run(["rm", "-rf", rm_dir], check=True)
|
||||||
|
|
||||||
return loc
|
return loc
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user