Skip to content

Commit

Permalink
356 - update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
regis-leray committed Aug 10, 2023
1 parent 1a61d8d commit 648835b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/site.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
generate-readme:
name: Generate README
runs-on: ubuntu-latest
if: ${{ (github.event_name == 'push') || ((github.event_name == 'release') && (github.event_name == 'published')) }}
if: ${{ (github.event_name == 'push') || ((github.event_name == 'release') && (github.event.action == 'published')) }}
steps:
- name: Git Checkout
uses: actions/checkout@v3.3.0
Expand Down
8 changes: 4 additions & 4 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.9.3")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.8")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.6")
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.10")
addSbtPlugin("ch.epfl.scala" % "sbt-bloop" % "1.5.0")
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.12")
addSbtPlugin("ch.epfl.scala" % "sbt-bloop" % "1.5.9")
addSbtPlugin("ch.epfl.scala" % "sbt-scalafix" % "0.9.29")
addSbtPlugin("dev.zio" % "zio-sbt-website" % "0.3.5")
addSbtPlugin("dev.zio" % "zio-sbt-website" % "0.3.10")
2 changes: 1 addition & 1 deletion zio-ftp/src/main/scala/zio/ftp/SecureFtp.scala
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ final private class SecureFtp(unsafeClient: Client) extends FtpAccessors[Client]
object SecureFtp {
type Client = SFTPClient

def apply(unsafeClient: Client): URIO[Scope, FtpAccessors[Client]] =
def connect(unsafeClient: Client, credentials: FtpCredentials): URIO[Scope, FtpAccessors[Client]] =
acquireRelease(ZIO.succeed(new SecureFtp(unsafeClient)))(cli =>
cli
.execute(_.close())
Expand Down
11 changes: 7 additions & 4 deletions zio-ftp/src/main/scala/zio/ftp/UnsecureFtp.scala
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,13 @@ final private class UnsecureFtp(unsafeClient: Client) extends FtpAccessors[Clien
object UnsecureFtp {
type Client = JFTPClient

def apply(unsafeClient: Client): URIO[Scope, FtpAccessors[Client]] =
acquireRelease(ZIO.succeed(new UnsecureFtp(unsafeClient))) { client =>
client.execute(_.logout()).ignore *> client.execute(_.disconnect()).ignore
}
def connect(unsafeClient: Client, credentials: FtpCredentials): ZIO[Scope, ConnectionError, FtpAccessors[Client]] =
acquireRelease(for{
client <- ZIO.succeed(new UnsecureFtp(unsafeClient))
_ <- client.execute(_.login(credentials.username, credentials.password))
.mapError(error => ConnectionError(error.getMessage, error))
.filterOrFail(identity)(ConnectionError("Cannot connect to the server"))
} yield client)(client => client.execute(_.logout()).ignore *> client.execute(_.disconnect()).ignore)

def connect(settings: UnsecureFtpSettings): ZIO[Scope, ConnectionError, FtpAccessors[Client]] =
acquireRelease(
Expand Down

0 comments on commit 648835b

Please sign in to comment.