Skip to content

Commit

Permalink
Strip whitespace from Figma API key when read from .config file (#1779)
Browse files Browse the repository at this point in the history
This makes sure that we don't try to authenticate to Figma with the key
with newlines or spaces in it.
  • Loading branch information
timothyfroehlich authored Nov 11, 2024
1 parent 635ca57 commit 6a52933
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions crates/figma_import/src/tools/fetch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ pub fn fetch(args: Args) -> Result<(), ConvertError> {

std::fs::read_to_string(config_path)
.expect("Could not read API key from ~/.config/figma_access_token")
.trim()
.parse()
.unwrap()
});

let mut doc: Document = Document::new(
Expand Down

0 comments on commit 6a52933

Please sign in to comment.