diff --git a/Sources/Compiler/Config.swift b/Sources/Compiler/Config.swift index 0848b66..3a7e0b9 100644 --- a/Sources/Compiler/Config.swift +++ b/Sources/Compiler/Config.swift @@ -31,8 +31,14 @@ public struct Config: Codable { } public init(at path: String) throws { - guard var url = URL(string: path) else { - throw ConfigError.invalidURL(path) + var url: URL + if path.hasPrefix("file://") { + guard let u = URL(string: path) else { + throw ConfigError.invalidURL(path) + } + url = u + } else { + url = URL(fileURLWithPath: path) } if url.lastPathComponent != "puresql.yaml" { diff --git a/Sources/Compiler/Gen/Rewriter.swift b/Sources/Compiler/Gen/Rewriter.swift index d700358..d0f45ad 100644 --- a/Sources/Compiler/Gen/Rewriter.swift +++ b/Sources/Compiler/Gen/Rewriter.swift @@ -40,7 +40,13 @@ struct Rewriter { final.append(contentsOf: source[start..