Skip to content

Commit cb98b0a

Browse files
authored
Fixes an issue when exporting resources to a Swift Package (#136)
1 parent da450fd commit cb98b0a

File tree

4 files changed

+22
-0
lines changed

4 files changed

+22
-0
lines changed

Sources/FigmaExport/Subcommands/ExportColors.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,12 @@ extension FigmaExportCommand {
102102

103103
try fileWriter.write(files: files)
104104

105+
guard iosParams.xcassetsInSwiftPackage == false else {
106+
checkForUpdate(logger: logger)
107+
logger.info("Done!")
108+
return
109+
}
110+
105111
do {
106112
let xcodeProject = try XcodeProjectWriter(xcodeProjPath: iosParams.xcodeprojPath, target: iosParams.target)
107113
try files.forEach { file in
@@ -113,6 +119,8 @@ extension FigmaExportCommand {
113119
} catch {
114120
logger.error("Unable to add some file references to Xcode project")
115121
}
122+
123+
logger.info("Done!")
116124
}
117125

118126
private func exportAndroidColors(colorPairs: [AssetPair<Color>], androidParams: Params.Android) throws {

Sources/FigmaExport/Subcommands/ExportIcons.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,12 @@ extension FigmaExportCommand {
8989
logger.info("Writting files to Xcode project...")
9090
try fileWriter.write(files: localFiles)
9191

92+
guard params.ios?.xcassetsInSwiftPackage == false else {
93+
checkForUpdate(logger: logger)
94+
logger.info("Done!")
95+
return
96+
}
97+
9298
do {
9399
let xcodeProject = try XcodeProjectWriter(xcodeProjPath: ios.xcodeprojPath, target: ios.target)
94100
try localFiles.forEach { file in

Sources/FigmaExport/Subcommands/ExportImages.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,12 @@ extension FigmaExportCommand {
8282
logger.info("Writting files to Xcode project...")
8383
try fileWriter.write(files: localFiles)
8484

85+
guard params.ios?.xcassetsInSwiftPackage == false else {
86+
checkForUpdate(logger: logger)
87+
logger.info("Done!")
88+
return
89+
}
90+
8591
do {
8692
let xcodeProject = try XcodeProjectWriter(xcodeProjPath: ios.xcodeprojPath, target: ios.target)
8793
try localFiles.forEach { file in

Sources/FigmaExport/Subcommands/ExportTypography.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ extension FigmaExportCommand {
8484

8585
try fileWriter.write(files: files)
8686

87+
guard iosParams.xcassetsInSwiftPackage == false else { return }
88+
8789
do {
8890
let xcodeProject = try XcodeProjectWriter(xcodeProjPath: iosParams.xcodeprojPath, target: iosParams.target)
8991
try files.forEach { file in

0 commit comments

Comments
 (0)