Structure
DirectoryConfiguration
public struct DirectoryConfiguration
DirectoryConfiguration
represents a configured working directory.
It can also be used to derive a working directory automatically.
let dirConfig = DirectoryConfiguration.detect()
print(dirConfig.workingDirectory) // "/path/to/workdir"
Initializers
init(workingDirectory:)
public init(workingDirectory: String)
Create a new DirectoryConfig
with a custom working directory.
Parameters
Name | Type | Description |
---|---|---|
workingDirectory | String |
Custom working directory path. |
Properties
resourcesDirectory
public var resourcesDirectory: String
viewsDirectory
public var viewsDirectory: String
publicDirectory
public var publicDirectory: String
Methods
detect()
public static func detect() -> DirectoryConfiguration
Creates a DirectoryConfig
by deriving a working directory using the #file
variable or getcwd
method.
Returns
The derived DirectoryConfig
if it could be created, otherwise just "./".