mirror of
https://github.com/yonaskolb/XcodeGen.git
synced 2024-10-26 14:01:24 +03:00
Add: markdown renderer command flag
This commit is contained in:
parent
e7f753785e
commit
24f8ae15cf
@ -22,6 +22,9 @@ class GenerateCommand: ProjectCommand {
|
||||
|
||||
@Flag("--only-plists", description: "Generate only plist files")
|
||||
var onlyPlists: Bool
|
||||
|
||||
@Flag("--render-markdowns", description: "Render markdown files with `.md` extension")
|
||||
var renderMarkdowns: Bool
|
||||
|
||||
init(version: Version) {
|
||||
super.init(version: version,
|
||||
@ -115,6 +118,16 @@ class GenerateCommand: ProjectCommand {
|
||||
} catch {
|
||||
throw GenerationError.writingError(error)
|
||||
}
|
||||
|
||||
// add markdown renderer if needed
|
||||
if renderMarkdowns {
|
||||
do {
|
||||
try fileWriter.writeMarkdownRendererPlist()
|
||||
success("Created markdown renderer in the project file")
|
||||
} catch {
|
||||
throw GenerationError.writingError(error)
|
||||
}
|
||||
}
|
||||
|
||||
// write cache
|
||||
if let cacheFile = cacheFile {
|
||||
|
@ -40,6 +40,10 @@ public class FileWriter {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public func writeMarkdownRendererPlist() throws {
|
||||
try writePlist([:], path: project.defaultProjectPath.string.appending("/.xcodesamplecode.plist"))
|
||||
}
|
||||
|
||||
private func writePlist(_ plist: [String: Any], path: String) throws {
|
||||
let path = project.basePath + path
|
||||
|
Loading…
Reference in New Issue
Block a user