Created
April 1, 2020 23:54
-
-
Save zac/824b89b5927f51a3cb7327f0051b99ef to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
let env = ProcessInfo.processInfo.environment | |
guard let deviceFamily = env["TARGETED_DEVICE_FAMILY"], | |
let projectPath = env["PROJECT_DIR"], | |
let project = env["PROJECT"] else { | |
exit(1) | |
} | |
var idioms: Set<Idiom> = [.marketing] | |
if deviceFamily.contains("1") { | |
idioms.insert(.iPhone) | |
} | |
if deviceFamily.contains("2") { | |
idioms.insert(.iPad) | |
} | |
idioms.insert(.marketing) | |
let set = IconSet(idioms: idioms, view: Icon()) | |
try! set.write( | |
to: URL(fileURLWithPath: projectPath) | |
.appendingPathComponent(project) | |
.appendingPathComponent("Assets.xcassets") | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment