Skip to content

Commit

Permalink
v3.1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
vrrashkov committed Jul 4, 2023
1 parent 3816622 commit 7981b82
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "design_token_parser"
version = "3.1.3"
version = "3.1.4"
edition = "2021"
repository = "https://github.com/vrrashkov/TokenParser"
readme = "README.md"
Expand Down
1 change: 1 addition & 0 deletions src/deserializer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ pub struct ConfigTokensGlobalOtherPathCombineWithMode {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(default)]
pub file_name: Option<String>,
pub merge: Vec<String>,
#[serde(alias = "files")]
pub files: Vec<GlobalOtherPathCombine>
}
Expand Down
8 changes: 4 additions & 4 deletions src/figma_parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ pub fn filter_properties(token_config: &deserializer::TokensConfig) {
// merging files and updating the values
// the merged files are dependant on the config

let mut data_object: serde_json::Value = serde_json::Value::Null;
let mut file_name = String::from("");
'figma_output: for group in &token_config.global.figma_output_paths {

let mut data_object: serde_json::Value = serde_json::Value::Null;
for (index, fileData) in group.combine.files.iter().enumerate() {
let combineFileName = &group.combine.file_name.to_owned().unwrap();

Expand All @@ -99,11 +99,11 @@ pub fn filter_properties(token_config: &deserializer::TokensConfig) {

let uniqueName = Path::new(&fileData.path).file_stem().unwrap().to_str().unwrap().to_owned();

if !&currentList.contains(&fileData.path) {
if !&currentList.contains(&fileData.path) || !group.combine.merge.contains(&sourceFileName.to_owned()) {
continue
}
dbg!(&currentList);
dbg!(&fileData.path);
dbg!(currentList);
dbg!(&uniqueName);

let mut data_to_merge_with: serde_json::Value = general::get_json(&fileData.path);

Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ fn main() {

// Covert to usable code
let matches: clap::ArgMatches = Command::new("Design Tokens")
.version("3.1.3")
.version("3.1.4")
.author("Vladislav R. <[email protected]>")
.about("Parses figma design tokens to usable code")
.arg(Arg::new("config").short('c').long("config").action(ArgAction::Set).required(true))
Expand Down

0 comments on commit 7981b82

Please sign in to comment.