Skip to content

Commit

Permalink
поддержа jam файлов
Browse files Browse the repository at this point in the history
  • Loading branch information
ritds committed Mar 5, 2022
1 parent a93897a commit ed2aa1f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions download_figma_files.js
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,12 @@ const puppeteer = require('puppeteer');
fse.moveSync(downloadDir + fileName+'.fig', downloadDir + fileName + '_' + now + '.fig')
}

if (fs.existsSync(downloadDir + fileName+'.jam')) {
const now = new Date().toISOString().substring(0, 19).replaceAll('T', '_').replaceAll(':','-');
fse.moveSync(downloadDir + fileName+'.jam', downloadDir + fileName + '_' + now + '.jam')
}


console.log("Directory to save the file: '" + downloadDir + "'");

fs.mkdirSync(downloadDir, {recursive: true});
Expand Down Expand Up @@ -324,6 +330,11 @@ const puppeteer = require('puppeteer');
console.log('Download complete');
break;
}

if (fs.existsSync(downloadDir + fileName+'.jam')) {
console.log('Download complete');
break;
}

if (j % 30 == 0) {
console.log(`waiting files to download for ${parseInt(j / 60)} min ${j % 60} sec.`)
Expand Down

0 comments on commit ed2aa1f

Please sign in to comment.