Skip to content

Commit

Permalink
camelCase done
Browse files Browse the repository at this point in the history
  • Loading branch information
vivasvan1 committed Apr 24, 2024
1 parent d655dee commit 7a6d2cc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ object ConfigFileArgsPlatformSpecific extends ConfigFilePlatformSpecific {

// Use ZIO to filter the paths
for {
do_path_exist <- ZIO.foreach(pathsToCheck)(path => ZIO.succeed(Files.exists(Path.of(path, filename))))
existing_paths = do_path_exist.zip(pathsToCheck).collect { case (exists, path) if exists => path }
} yield existing_paths.distinct // Use distinct to remove duplicates at the end
doPathExist <- ZIO.foreach(pathsToCheck)(path => ZIO.succeed(Files.exists(Path.of(path, filename))))
existingPaths = doPathExist.zip(pathsToCheck).collect { case (exists, path) if exists => path }
} yield existingPaths.distinct // Use distinct to remove duplicates at the end
}

def loadOptionsFromConfigFiles(topLevelCommand: String): ZIO[Any, IOException, List[String]] =
Expand Down
4 changes: 2 additions & 2 deletions zio-cli/jvm/src/test/scala/zio/cli/FileBasedArgs.scala
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ object FileBasedArgs extends ZIOSpecDefault {
_ <- createSampleConfigFiles(cwd, homeDir, command)

// Check if the func checkAndGetOptionsFilePaths can
config_args <- configFileOps.loadOptionsFromConfigFiles(command)
configArgs <- configFileOps.loadOptionsFromConfigFiles(command)

_ <- cleanUpSampleConfigFiles(cwd: Path, homeDir: Path, command)

} yield assert(config_args)(hasSameElements(List("home=true", "dir=true", "home=false")))
} yield assert(configArgs)(hasSameElements(List("home=true", "dir=true", "home=false")))
},
test("should return directory ~/home and ./ which have .testApp config file for loading the args") {
for {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ object ConfigFileArgsPlatformSpecific extends ConfigFilePlatformSpecific {

// Use ZIO to filter the paths
for {
do_path_exist <- ZIO.foreach(pathsToCheck)(path => ZIO.succeed(Files.exists(Path.of(path, filename))))
existing_paths = do_path_exist.zip(pathsToCheck).collect { case (exists, path) if exists => path }
} yield existing_paths.distinct // Use distinct to remove duplicates at the end
doPathExist <- ZIO.foreach(pathsToCheck)(path => ZIO.succeed(Files.exists(Path.of(path, filename))))
existingPaths = doPathExist.zip(pathsToCheck).collect { case (exists, path) if exists => path }
} yield existingPaths.distinct // Use distinct to remove duplicates at the end
}

def loadOptionsFromConfigFiles(topLevelCommand: String): ZIO[Any, IOException, List[String]] =
Expand Down

0 comments on commit 7a6d2cc

Please sign in to comment.