Skip to content

Commit

Permalink
[WIP]: show file save progress.
Browse files Browse the repository at this point in the history
  • Loading branch information
h-sug1no committed Dec 21, 2021
1 parent faba418 commit b5ad91f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tools/generate_images_pptr.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ args.forEach((str) => {

usage();

const progressChars = ['|', '/', '-', '\\'];
let progressCharsIndex = 0;
const savePNGData = (filename, pngDataURL) => {
let ret = false;
if (pngDataURL.split) {
Expand All @@ -75,6 +77,7 @@ const savePNGData = (filename, pngDataURL) => {
fs.writeFileSync(filename, imageBuffer, { encoding: 'base64' });
ret = true;
}
progress(progressChars[progressCharsIndex++ % progressChars.length]);
return ret;
};

Expand Down

0 comments on commit b5ad91f

Please sign in to comment.