Skip to content

Commit

Permalink
Fix project directory path
Browse files Browse the repository at this point in the history
  • Loading branch information
artemnovichkov committed Jul 29, 2019
1 parent 8c6fc74 commit 3cfca1a
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions Sources/CartingCore/Services/ProjectService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ public final class ProjectService {
static let carthageScript = "/usr/local/bin/carthage copy-frameworks"
}

public let projectDirectoryPath: String
public let projectDirectoryPath: String?

private var projectFolder: Folder {
if let folder = try? Folder(path: projectDirectoryPath) {
if let path = projectDirectoryPath, let folder = try? Folder(path: path) {
return folder
}
return FileSystem().currentFolder
Expand All @@ -31,9 +31,6 @@ public final class ProjectService {
// MARK: - Lifecycle

public init(projectDirectoryPath: String?) throws {
guard let projectDirectoryPath = projectDirectoryPath else {
throw Error.projectFileReadingFailed
}
self.projectDirectoryPath = projectDirectoryPath
}

Expand Down

0 comments on commit 3cfca1a

Please sign in to comment.