diff --git a/src/main/scala/Main.scala b/src/main/scala/Main.scala index ea050c6..d08c2fd 100644 --- a/src/main/scala/Main.scala +++ b/src/main/scala/Main.scala @@ -20,7 +20,7 @@ object Main extends TaskApp { db <- EitherT.liftF[Task, Exception, MongoDatabase](database.getDatabase(config, mongoClient)) userInput <- EitherT(promptUser()) csvFiles <- EitherT(FileHelper.getCsvFiles(userInput.folderPath, userInput.skipFiles)) - orderedFiles = csvFiles.zipWithIndex.toOrderedFile() + orderedFiles = csvFiles.zipWithIndex.toOrderedFile _ <- EitherT(Processing.csvFiles(orderedFiles)(db)) } yield { database.close(mongoClient) diff --git a/src/main/scala/util/config/ConfigFile.scala b/src/main/scala/util/config/ConfigFile.scala index 2f7ba0c..34c3f9f 100644 --- a/src/main/scala/util/config/ConfigFile.scala +++ b/src/main/scala/util/config/ConfigFile.scala @@ -9,13 +9,16 @@ import util.Logging.log import util.ImplicitConversions.RichConfig import util.models.enums.MongoDbEnvironmentNames +import scala.reflect.io.{Directory, Path} + case object ConfigFile extends SystemConfigProperties { - /** validate of the configeration method is present + /** validate of the configuration method is present * * @return Boolean, true if it exists */ override def exists: Boolean = { - val exist = !ConfigFactory.load().isEmpty + val configPath = Path("src/main/resources/application.conf") + val exist = Directory(configPath).exists log.info(s"Check if config file: application.conf exists: $exist") exist } diff --git a/src/main/scala/util/config/EnvironmentVariables.scala b/src/main/scala/util/config/EnvironmentVariables.scala index 8233e02..84b3b2f 100644 --- a/src/main/scala/util/config/EnvironmentVariables.scala +++ b/src/main/scala/util/config/EnvironmentVariables.scala @@ -8,7 +8,7 @@ import util.Logging.log import util.models.enums.MongoDbEnvironmentNames case object EnvironmentVariables extends SystemConfigProperties { - /** validate of the configeration method is present + /** validate of the configuration method is present * * @return Boolean, true if it exists */ diff --git a/src/main/scala/util/databaseProvider/SystemConfigProperties.scala b/src/main/scala/util/databaseProvider/SystemConfigProperties.scala index 132d6fe..e2831b8 100644 --- a/src/main/scala/util/databaseProvider/SystemConfigProperties.scala +++ b/src/main/scala/util/databaseProvider/SystemConfigProperties.scala @@ -3,7 +3,7 @@ package util.databaseProvider import util.models.SystemConfigPropertiesResponse trait SystemConfigProperties { - /** validate of the configeration method is present + /** validate of the configuration method is present * * @return Boolean, true if it exists */