fix: make it work for joj3-forge-convert
This commit is contained in:
parent
2c1ad47f14
commit
b14d83c37b
|
@ -1,3 +1,4 @@
|
||||||
|
import os
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import List
|
from typing import List
|
||||||
|
|
||||||
|
@ -62,5 +63,9 @@ class Config(BaseModel):
|
||||||
@model_validator(mode="after")
|
@model_validator(mode="after")
|
||||||
def set_grading_repo_name_from_cwd(self) -> "Config":
|
def set_grading_repo_name_from_cwd(self) -> "Config":
|
||||||
if not self.grading_repo_name:
|
if not self.grading_repo_name:
|
||||||
self.grading_repo_name = Path.cwd().name
|
course_env = os.getenv("COURSE")
|
||||||
|
if course_env:
|
||||||
|
self.grading_repo_name = f"{course_env}-joj"
|
||||||
|
else:
|
||||||
|
self.grading_repo_name = Path.cwd().name
|
||||||
return self
|
return self
|
||||||
|
|
Loading…
Reference in New Issue
Block a user