Skip to content

Commit

Permalink
added comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jxmot committed May 20, 2021
1 parent 9af5831 commit 2129ea5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,13 +113,21 @@ for(let idx = 0; idx < targetopt.views.length; idx++) {
}
}

/*
targetopt.views[] can contain either viewport dimensions:
{width:950, height:1080}
OR device names:
{device:'Nexus 6P'}
*/
if(targetopt.views[idx].width) {
// add the viewport dimensions to the name
name = name + '-' + targetopt.views[idx].width + 'x' + targetopt.views[idx].height;
log(`queuing: target = ${target} snapshot file = ${imgpath}${name}${imgextn}`);
}

if(targetopt.views[idx].device) {
// add the device name to the file name
name = name + '-' + targetopt.views[idx].device.replace(/ /g,'_');
log(`queuing: target = ${target} snapshot file = ${imgpath}${name}${imgextn}`);
}
Expand Down

0 comments on commit 2129ea5

Please sign in to comment.