Skip to content

Commit

Permalink
common-fs2: fix env var substitution for JSON files (close #753)
Browse files Browse the repository at this point in the history
  • Loading branch information
benjben committed Mar 16, 2023
1 parent bb71d94 commit e1e1577
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ object FileSystem {
.subflatMap { text =>
val either = for {
tsConfig <- Either.catchNonFatal(ConfigFactory.parseString(text)).leftMap(_.getMessage)
tsConfig <- Either.catchNonFatal(fallbacks(tsConfig)).leftMap(_.getMessage)
parsed <- tsConfig.as[A].leftMap(_.show)
resolved <- Either.catchNonFatal(tsConfig.resolve()).leftMap(e => s"Can't resolve config: ${e.getMessage}")
withFallbacks <- Either.catchNonFatal(fallbacks(resolved)).leftMap(_.getMessage)
parsed <- withFallbacks.as[A].leftMap(_.show)
} yield parsed
either.leftMap(reason => s"Cannot parse file $path: $reason")
}
Expand Down

0 comments on commit e1e1577

Please sign in to comment.