From 744e9c6f7ed95756781b81482180c6e3d91a9c80 Mon Sep 17 00:00:00 2001 From: Eric Loots Date: Mon, 31 Jul 2023 18:09:59 +0200 Subject: [PATCH] Format and fix messages from `cmta` `studentify`/`linearize`/`delinearize` (#273) --- .../com/lunatech/cmt/admin/command/Delinearize.scala | 8 ++++---- .../scala/com/lunatech/cmt/admin/command/Linearize.scala | 8 ++++---- .../scala/com/lunatech/cmt/admin/command/Studentify.scala | 6 ++++-- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/cmta/src/main/scala/com/lunatech/cmt/admin/command/Delinearize.scala b/cmta/src/main/scala/com/lunatech/cmt/admin/command/Delinearize.scala index 3448dd93..9ce904eb 100644 --- a/cmta/src/main/scala/com/lunatech/cmt/admin/command/Delinearize.scala +++ b/cmta/src/main/scala/com/lunatech/cmt/admin/command/Delinearize.scala @@ -42,14 +42,14 @@ object Delinearize: for { _ <- Right(()).withLeft[CmtError] - _ = println(s"De-linearizing ${toConsoleGreen(mainRepository.value.getPath)} to ${toConsoleGreen( - options.linearizeBaseDirectory.value.getPath)}") mainRepoName = mainRepository.value.getName + linearizedRootFolder = options.linearizeBaseDirectory.value / mainRepoName - ExercisesMetadata(_, exercisesInMain, _) <- getExerciseMetadata(mainRepository.value)(config) + _ = println( + s"De-linearizing ${toConsoleGreen(linearizedRootFolder.getPath)} to ${toConsoleGreen(mainRepository.value.getCanonicalPath)}") - linearizedRootFolder = options.linearizeBaseDirectory.value / mainRepoName + ExercisesMetadata(_, exercisesInMain, _) <- getExerciseMetadata(mainRepository.value)(config) exercisesAndSHAsInLinearized <- getExercisesAndSHAs(linearizedRootFolder) diff --git a/cmta/src/main/scala/com/lunatech/cmt/admin/command/Linearize.scala b/cmta/src/main/scala/com/lunatech/cmt/admin/command/Linearize.scala index e066b3ca..a769c46f 100644 --- a/cmta/src/main/scala/com/lunatech/cmt/admin/command/Linearize.scala +++ b/cmta/src/main/scala/com/lunatech/cmt/admin/command/Linearize.scala @@ -54,12 +54,12 @@ object Linearize: mainRepoName = mainRepository.value.getName tmpFolder = sbtio.createTemporaryDirectory cleanedMainRepo = tmpFolder / mainRepository.value.getName - ExercisesMetadata(prefix, exercises, exerciseNumbers) <- getExerciseMetadata(mainRepository.value)(config) + ExercisesMetadata(_, exercises, _) <- getExerciseMetadata(mainRepository.value)(config) linearizedRootFolder = options.linearizeBaseDirectory.value / mainRepoName - _ = println( - s"Linearizing ${toConsoleGreen(mainRepoName)} to ${toConsoleGreen(options.linearizeBaseDirectory.value.getPath)}") - + _ = { + println(s"Linearizing ${toConsoleGreen(mainRepoName)} to ${toConsoleGreen(linearizedRootFolder.getPath)}") + } _ <- checkpreExistingAndCreateArtifactRepo( options.linearizeBaseDirectory.value, linearizedRootFolder, diff --git a/cmta/src/main/scala/com/lunatech/cmt/admin/command/Studentify.scala b/cmta/src/main/scala/com/lunatech/cmt/admin/command/Studentify.scala index 1547212a..94f462e5 100644 --- a/cmta/src/main/scala/com/lunatech/cmt/admin/command/Studentify.scala +++ b/cmta/src/main/scala/com/lunatech/cmt/admin/command/Studentify.scala @@ -83,8 +83,10 @@ object Studentify: studentifiedRootFolder = options.studentifyBaseDirectory.value / mainRepoName solutionsFolder = studentifiedRootFolder / config.studentifiedRepoSolutionsFolder - _ = println( - s"Studentifying ${toConsoleGreen(mainRepoName)} to ${toConsoleGreen(options.studentifyBaseDirectory.value.getPath)}") + _ = { + val destinationPath = (options.studentifyBaseDirectory.value / mainRepoName).getPath + println(s"Studentifying ${toConsoleGreen(mainRepoName)} to ${toConsoleGreen(destinationPath)}") + } _ <- checkpreExistingAndCreateArtifactRepo( options.studentifyBaseDirectory.value,