Skip to content

Commit

Permalink
feat: add shell script to get file info json from figma api
Browse files Browse the repository at this point in the history
  • Loading branch information
feerglas committed Aug 18, 2020
1 parent d49b46a commit 62177f3
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions figma_extractor/figma_extractor.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash

# this script is used in .travis.yml

# this script is being made executable with
# chmod ugo+x figma_extractor.sh

# set flags for execution of this file:
# -e: make sure command returns non-zero exit code as soon as somehting fails
# set -e

# During local development, we want to use the .env file. On CI, we
# will pass these variables as options
if [ -f .env ]
then
export $(cat .env | sed 's/#.*//g' | xargs)
fi

ACCESS_TOKEN=${FIGMA_ACCESS_TOKEN}
FILE_URL=${FIGMA_FILE_URL}
JSON_FILENAME=${FIGMA_JSON_FILENAME}

curl -sH "X-Figma-Token: $FIGMA_ACCESS_TOKEN" "$FIGMA_FILE_URL" -o $FIGMA_JSON_FILENAME

0 comments on commit 62177f3

Please sign in to comment.