File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
packages/gatsby-plugin-sharp/src Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ export function createGatsbyProgressOrFallbackToExternalProgressBar(
1212 const bar = new ProgressBar (
1313 ` [:bar] :current/:total :elapsed s :percent ${ message } ` ,
1414 {
15- total : 0 ,
15+ total : 1 , // if you set this to 0 then you might get 0/0 errors
1616 width : 30 ,
1717 clear : true ,
1818 }
@@ -25,7 +25,7 @@ export function createGatsbyProgressOrFallbackToExternalProgressBar(
2525 } ,
2626 done ( ) { } ,
2727 set total ( value ) {
28- bar . total = value
28+ bar . total = Math . max ( value , 1 ) || 1 // Do not allow 0, negative numbers, or non-numbers.
2929 } ,
3030 }
3131}
@@ -56,7 +56,7 @@ export const createOrGetProgressBar = reporter => {
5656 progressBar . start ( )
5757 }
5858 pendingImagesCounter += imageCount
59- progressBar . total = pendingImagesCounter
59+ progressBar . total = Math . max ( 1 , pendingImagesCounter ) // 0 will cause 0/0 error
6060 }
6161
6262 // when we create a progressBar for the second time so when .done() has been called before
You can’t perform that action at this time.
0 commit comments