From 2a58aec3148714e828396310ff84ed61df5d4582 Mon Sep 17 00:00:00 2001
From: Boming Zhang <bomingzh@sjtu.edu.cn>
Date: Sun, 27 Oct 2024 06:27:17 -0400
Subject: [PATCH] refactor(cmd/joj3): add teapot env file path to conf [force
 rebuild]

---
 cmd/joj3/conf/conf.go  | 1 +
 cmd/joj3/teapot/run.go | 3 +--
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/cmd/joj3/conf/conf.go b/cmd/joj3/conf/conf.go
index 2f1c94e..bba1b4d 100644
--- a/cmd/joj3/conf/conf.go
+++ b/cmd/joj3/conf/conf.go
@@ -42,6 +42,7 @@ type Conf struct {
 	}
 	Teapot struct {
 		LogPath         string `default:"/home/tt/.cache/joint-teapot-debug.log"`
+		EnvFilePath     string `default:"/home/tt/.config/teapot/teapot.env"`
 		ScoreboardPath  string `default:"scoreboard.csv"`
 		FailedTablePath string `default:"failed-table.md"`
 		GradingRepoName string `default:""`
diff --git a/cmd/joj3/teapot/run.go b/cmd/joj3/teapot/run.go
index 8711275..767c7a7 100644
--- a/cmd/joj3/teapot/run.go
+++ b/cmd/joj3/teapot/run.go
@@ -21,7 +21,6 @@ func Run(conf *conf.Conf) error {
 	}
 	os.Setenv("LOG_FILE_PATH", conf.Teapot.LogPath)
 	os.Setenv("_TYPER_STANDARD_TRACEBACK", "1")
-	envFilePath := "/home/tt/.config/teapot/teapot.env"
 	sha := os.Getenv("GITHUB_SHA")
 	actor := os.Getenv("GITHUB_ACTOR")
 	repository := os.Getenv("GITHUB_REPOSITORY")
@@ -77,7 +76,7 @@ func Run(conf *conf.Conf) error {
 		skipFailedTableArg = "--skip-failed-table"
 	}
 	if err := execCommand("joint-teapot", []string{
-		"joj3-all", envFilePath, conf.Stage.OutputPath, actor,
+		"joj3-all", conf.Teapot.EnvFilePath, conf.Stage.OutputPath, actor,
 		conf.Teapot.GradingRepoName, repoName, runNumber,
 		conf.Teapot.ScoreboardPath, conf.Teapot.FailedTablePath,
 		conf.Name, sha, skipIssueArg, skipScoreboardArg,