Skip to content

Commit

Permalink
Fix travis failures
Browse files Browse the repository at this point in the history
  • Loading branch information
kilnerm committed Jan 18, 2019
1 parent ef66dd5 commit 793eda9
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Sources/Kitura/staticFileServer/StaticFileServer.swift
Expand Up @@ -105,9 +105,15 @@ open class StaticFileServer: RouterMiddleware {
customResponseHeadersSetter: ResponseHeadersSetter? = nil) {
absoluteRootPath = StaticFileServer.ResourcePathHandler.getAbsolutePath(for: path)
// Check the supplied path is a directory and if not fail initialisation
var isDirectory = ObjCBool(booleanLiteral: false)
var isDirectory = ObjCBool(false)

let pathExists = FileManager.default.fileExists(atPath: absoluteRootPath, isDirectory: &isDirectory)
guard pathExists, isDirectory.boolValue else {
#if !os(Linux) || swift(>=4.1)
let isDirectoryBool = isDirectory.boolValue
#else
let isDirectoryBool = isDirectory
#endif
guard pathExists, isDirectoryBool else {
return nil
}

Expand Down

0 comments on commit 793eda9

Please sign in to comment.