fix clone target folder
This commit is contained in:
@@ -39,8 +39,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(f"~/temp/PICable/{repo}")
|
||||||
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)
|
||||||
@@ -54,7 +53,7 @@ def get_lines_of_code(owner, repo):
|
|||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
loc = 0
|
loc = 0
|
||||||
subprocess.run(["rm", "-rf", rm_dir], check=True)
|
subprocess.run(["rm", "-rf", clone_dir], check=True)
|
||||||
|
|
||||||
return loc
|
return loc
|
||||||
|
|
||||||
@@ -117,3 +116,5 @@ def PICable(owner, repository, token):
|
|||||||
res += f"The repository {repository_url} is almost PICable. There are certain requirements which are almost met by this repository. Consult with a professor before proceeding. :warning:\n"
|
res += f"The repository {repository_url} is almost PICable. There are certain requirements which are almost met by this repository. Consult with a professor before proceeding. :warning:\n"
|
||||||
|
|
||||||
return res
|
return res
|
||||||
|
|
||||||
|
print(PICable("Enzo-Nunes", "SkyForge", "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"))
|
||||||
Reference in New Issue
Block a user