Comparing version 0.2.0 to 0.2.1
@@ -6,3 +6,3 @@ const fs = require('fs'); | ||
function downloadImages() { | ||
fs.readFile('figma/images.json', 'utf-8', function read(error, data) { | ||
fs.readFile(`${process.cwd()}/figma/images.json`, 'utf-8', function read(error, data) { | ||
if (error) { | ||
@@ -24,3 +24,3 @@ console.warn(error); | ||
const imageName = Object.keys(_data)[index]; | ||
download(image, `specs/images/${imageName}.jpg`, function() { | ||
download(image, `specs/images/${imageName}.jpg`, function () { | ||
console.log(`Downloaded image: ${imageName}`); | ||
@@ -33,4 +33,4 @@ }); | ||
const download = function(uri, filename, callback) { | ||
request.head(uri, function(err, res, body) { | ||
const download = function (uri, filename, callback) { | ||
request.head(uri, function (err, res, body) { | ||
request(uri) | ||
@@ -37,0 +37,0 @@ .pipe(fs.createWriteStream(filename)) |
@@ -8,5 +8,5 @@ const fs = require('fs'); | ||
const options = { | ||
url: `https://api.figma.com/v1/images/KLLDK9CBSg7eAayiTY3kVqC8?ids=${resolvedImageIds}&format=png&scale=2`, | ||
url: `https://api.figma.com/v1/images/{FILE}?ids=${resolvedImageIds}&format=png&scale=2`, | ||
headers: { | ||
'X-Figma-Token': '363-7526bfc3-cb4d-487e-80fe-461679ae1470' | ||
'X-Figma-Token': '{TOKEN}' | ||
} | ||
@@ -71,3 +71,3 @@ }; | ||
'utf-8', | ||
function(error) { | ||
function (error) { | ||
if (error) { | ||
@@ -74,0 +74,0 @@ return console.log(error); |
{ | ||
"name": "figmagic", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"author": "Mikael Vesavuori", | ||
@@ -14,7 +14,5 @@ "main": "index.js", | ||
"scripts": { | ||
"figmagic": | ||
"yarn figmagic:clean && yarn run figmagic:saveFromApi && yarn figmagic:build && yarn figmagic:getImages && yarn figmagic:downloadImages", | ||
"figmagic": "yarn figmagic:clean && yarn run figmagic:saveFromApi && yarn figmagic:build && yarn figmagic:getImages && yarn figmagic:downloadImages", | ||
"figmagic:clean": "rm -rf specs/ && rm -rf tokens/ && rm -rf figma", | ||
"figmagic:saveFromApi": | ||
"mkdir -p figma && wget 'https://api.figma.com/v1/files/KLLDK9CBSg7eAayiTY3kVqC8' --header='X-Figma-Token: 363-7526bfc3-cb4d-487e-80fe-461679ae1470' -O figma/figma.json", | ||
"figmagic:saveFromApi": "mkdir -p figma && wget 'https://api.figma.com/v1/files/KLLDK9CBSg7eAayiTY3kVqC8' --header='X-Figma-Token: 363-7526bfc3-cb4d-487e-80fe-461679ae1470' -O figma/figma.json", | ||
"figmagic:tokens": "yarn figmagic:clean && yarn figmagic:saveFromApi && yarn figmagic:build", | ||
@@ -21,0 +19,0 @@ "figmagic:build": "node $npm_package_config_figmagicPath/bin/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
24093