resgen.swift/Sources/ResgenSwift/Generate/Runnable/ImagesConfiguration+ShellCommandable.swift
Thibaut Schmitt 6203700b0c
Some checks failed
gitea-openium/resgen.swift/pipeline/head There was a failure building this commit
Publish v1.0
Reviewed-on: #1
2022-10-17 11:24:27 +02:00

44 lines
1.1 KiB
Swift

//
// ImagesConfiguration+Runnable.swift
//
//
// Created by Thibaut Schmitt on 30/08/2022.
//
import Foundation
extension ImagesConfiguration: Runnable {
func run(projectDirectory: String, force: Bool) {
var args = [String]()
if force {
args += ["-f"] // Images has a -f and -F options
}
args += [
inputFile.prependIfRelativePath(projectDirectory),
"--xcassets-path",
xcassetsPath.prependIfRelativePath(projectDirectory),
"--extension-output-path",
extensionOutputPath.prependIfRelativePath(projectDirectory),
"--static-members",
"\(staticMembersOptions)"
]
if let extensionName = extensionName {
args += [
"--extension-name",
extensionName
]
}
if let extensionSuffix = extensionSuffix {
args += [
"--extension-suffix",
extensionSuffix
]
}
Images.main(args)
}
}