diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 03838d7a2..0e2289a0e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -51,11 +51,14 @@ jobs: - name: Generate Tests Script using CMT run: | + git config --global user.email "no-reply@lunatech.com" + git config --global user.name "Lunatech Labs" (cd CMT/ && exec sbt "mainadm -dot -t ../runTests $GITHUB_WORKSPACE/course-repo") - name: Run Tests run: | chmod +x runTests + export PATH=${PATH}:$GITHUB_WORKSPACE/CMT/bin ./runTests create_release: @@ -104,6 +107,7 @@ jobs: - name: Studentify Repo run: | mkdir -p studentified + export PATH=${PATH}:$GITHUB_WORKSPACE/CMT/bin git config --global user.email "no-reply@lunatech.com" git config --global user.name "Lunatech Labs" (cd CMT/ && exec sbt "studentify -dot -g ../lunatech-scala-2-to-scala3-course ../studentified") diff --git a/exercises/project/CommonSettings.scala b/exercises/project/CommonSettings.scala index 01fa64117..6390a4976 100644 --- a/exercises/project/CommonSettings.scala +++ b/exercises/project/CommonSettings.scala @@ -22,6 +22,7 @@ import sbt.Keys._ import sbt._ import sbtstudent.AdditionalSettings import dotty.tools.sbtplugin.DottyPlugin.autoImport.DottyCompatModuleID +import sbtstudent.StudentCommandsPlugin._ object CommonSettings { @@ -41,7 +42,8 @@ object CommonSettings { publishArtifact in packageDoc := false, libraryDependencies ++= Dependencies.dependencies, libraryDependencies ++= Dependencies.crossDependencies.map(_.withDottyCompat(scalaVersion.value)), - testFrameworks += new TestFramework("munit.Framework") + testFrameworks += new TestFramework("munit.Framework"), + shellPrompt := (state => renderCMTPrompt(state)) ) ++ AdditionalSettings.initialCmdsConsole ++ AdditionalSettings.initialCmdsTestConsole ++ diff --git a/exercises/project/StudentCommandsPlugin.scala b/exercises/project/StudentCommandsPlugin.scala index 19c6382cb..59b2a2216 100644 --- a/exercises/project/StudentCommandsPlugin.scala +++ b/exercises/project/StudentCommandsPlugin.scala @@ -55,13 +55,15 @@ object StudentCommandsPlugin extends AutoPlugin { IO.readLines(new sbt.File(new sbt.File(Project.extract(state).structure.root), ".courseName")).head } - override lazy val projectSettings: Seq[Def.Setting[State => String]] = + def renderCMTPrompt(state: State) = { + val exercise = Console.GREEN + extractCurrentExerciseDesc(state) + Console.RESET + val manRmnd = Console.GREEN + "man [e]" + Console.RESET + val prjNbrNme = extractProjectName(state) + s"$manRmnd > $prjNbrNme > $exercise > " + } + + override def projectSettings: Seq[Def.Setting[State => String]] = Seq( - shellPrompt := { state => - val exercise = Console.GREEN + extractCurrentExerciseDesc(state) + Console.RESET - val manRmnd = Console.GREEN + "man [e]" + Console.RESET - val prjNbrNme = extractProjectName(state) - s"$manRmnd > $prjNbrNme > $exercise > " - } + shellPrompt := { state => renderCMTPrompt(state)} ) }