Skip to content

Commit

Permalink
Merge pull request #857 from vapor/swift-3.1-workdir
Browse files Browse the repository at this point in the history
swift 3.1 workdir fix
  • Loading branch information
tanner0101 committed Feb 22, 2017
2 parents 4007f3c + c648c35 commit 7041f78
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Sources/Vapor/Droplet/Droplet+WorkingDirectory.swift
@@ -1,7 +1,11 @@
extension Droplet {
static func workingDirectory(from arguments: [String]) -> String {
func fileWorkDirectory() -> String? {
let parts = #file.components(separatedBy: "/Packages/Vapor-")
#if swift(>=3.1)
let parts = #file.components(separatedBy: "/.build")
#else
let parts = #file.components(separatedBy: "/Packages/Vapor-")
#endif
guard parts.count == 2 else {
return nil
}
Expand Down

0 comments on commit 7041f78

Please sign in to comment.