Skip to content

Commit

Permalink
fix: allow using absent file path as an output
Browse files Browse the repository at this point in the history
This commit adds support for specifying an absent output file path and makes sure we generate it if it doesn't exist yet.
  • Loading branch information
maticzav authored Nov 14, 2021
2 parents 0121a6e + e19b44b commit 5d75fc4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/SwiftGraphQLCLI/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ struct SwiftGraphQLCLI: ParsableCommand {

// Write to target file or stdout.
if let outputPath = output {
try Folder.current.file(at: outputPath).write(code)
try Folder.current.createFile(at: outputPath).write(code)
} else {
FileHandle.standardOutput.write(code.data(using: .utf8)!)
}
Expand Down

0 comments on commit 5d75fc4

Please sign in to comment.