Skip to content

Commit

Permalink
Fix loading colors when common.colors not set (#251)
Browse files Browse the repository at this point in the history
Closes #243
  • Loading branch information
subdan authored Jan 24, 2025
1 parent 48d8ba0 commit cca6687
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions Sources/FigmaExport/Subcommands/ExportColors.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,28 +40,28 @@ extension FigmaExportCommand {
var nameValidateRegexp: String?
var nameReplaceRegexp: String?

if let colorParams = commonParams?.colors {
let loader = ColorsLoader(
if let variableParams = commonParams?.variablesColors {
let loader = ColorsVariablesLoader(
client: client,
figmaParams: figmaParams,
colorParams: colorParams,
variableParams: variableParams,
filter: filter
)
colors = try loader.load()
nameValidateRegexp = colorParams.nameValidateRegexp
nameReplaceRegexp = colorParams.nameReplaceRegexp
} else if let variableParams = commonParams?.variablesColors {
let loader = ColorsVariablesLoader(

nameValidateRegexp = variableParams.nameValidateRegexp
nameReplaceRegexp = variableParams.nameReplaceRegexp
} else {
let loader = ColorsLoader(
client: client,
figmaParams: figmaParams,
variableParams: variableParams,
colorParams: commonParams?.colors,
filter: filter
)
colors = try loader.load()

nameValidateRegexp = variableParams.nameValidateRegexp
nameReplaceRegexp = variableParams.nameReplaceRegexp
nameValidateRegexp = commonParams?.colors?.nameValidateRegexp
nameReplaceRegexp = commonParams?.colors?.nameReplaceRegexp
}

guard let colors else {
Expand Down

0 comments on commit cca6687

Please sign in to comment.