Add --project-directory option to generate command to easily use relative path
Some checks failed
gitea-openium/resgen.swift/pipeline/head There was a failure building this commit
Some checks failed
gitea-openium/resgen.swift/pipeline/head There was a failure building this commit
This commit is contained in:
@ -92,7 +92,7 @@ struct Colors: ParsableCommand {
|
||||
// MARK: - Helpers
|
||||
|
||||
private func deleteCurrentColors() {
|
||||
Shell.shell("rm", "-rf", "\(options.xcassetsPath)/Colors/*")
|
||||
Shell.shell(["rm", "-rf", "\(options.xcassetsPath)/Colors/*"])
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,7 @@ struct ColorExtensionGenerator {
|
||||
// Create file if not exists
|
||||
let fileManager = FileManager()
|
||||
if fileManager.fileExists(atPath: extensionFilePath) == false {
|
||||
Shell.shell("touch", "\(extensionFilePath)")
|
||||
Shell.shell(["touch", "\(extensionFilePath)"])
|
||||
}
|
||||
|
||||
// Create extension content
|
||||
|
@ -20,11 +20,12 @@ struct ColorXcassetHelper {
|
||||
private static func generateColorSetAssets(from color: ParsedColor, to xcassetsPath: String) {
|
||||
// Create ColorSet
|
||||
let colorSetPath = "\(xcassetsPath)/Colors/\(color.name).colorset"
|
||||
Shell.shell("mkdir", "-p", "\(colorSetPath)")
|
||||
Shell.shell(["mkdir",
|
||||
"-p", "\(colorSetPath)"])
|
||||
|
||||
// Create Contents.json in ColorSet
|
||||
let contentsJsonPath = "\(colorSetPath)/Contents.json"
|
||||
Shell.shell("touch", "\(contentsJsonPath)")
|
||||
Shell.shell(["touch", "\(contentsJsonPath)"])
|
||||
|
||||
// Write content in Contents.json
|
||||
let contentsJsonPathURL = URL(fileURLWithPath: contentsJsonPath)
|
||||
|
Reference in New Issue
Block a user