@@ -32,15 +32,15 @@ const {generateResultsArray} = require('./scripts/rollup/stats');
3232const { existsSync, readFileSync} = require ( 'fs' ) ;
3333const { exec} = require ( 'child_process' ) ;
3434
35- if ( ! existsSync ( './scripts/rollup/results .json' ) ) {
35+ if ( ! existsSync ( './build/bundle-sizes .json' ) ) {
3636// This indicates the build failed previously.
3737// In that case, there's nothing for the Dangerfile to do.
3838// Exit early to avoid leaving a redundant (and potentially confusing) PR comment.
3939process . exit ( 0 ) ;
4040}
4141
4242const currentBuildResults = JSON . parse (
43- readFileSync ( './scripts/rollup/results .json' )
43+ readFileSync ( './build/bundle-sizes .json' )
4444) ;
4545
4646/**
@@ -118,7 +118,7 @@ function git(args) {
118118await git ( 'fetch upstream' ) ;
119119const baseCommit = await git ( `merge-base HEAD upstream/${ upstreamRef } ` ) ;
120120
121- let resultsResponse = null ;
121+ let previousBuildResults = null ;
122122try {
123123let baseCIBuildId = null ;
124124const statusesResponse = await fetch (
@@ -153,8 +153,9 @@ function git(args) {
153153
154154for ( let i = 0 ; i < baseArtifactsInfo . length ; i ++ ) {
155155const info = baseArtifactsInfo [ i ] ;
156- if ( info . path === 'home/circleci/project/scripts/rollup/results.json' ) {
157- resultsResponse = await fetch ( info . url ) ;
156+ if ( info . path === 'home/circleci/project/build/bundle-sizes.json' ) {
157+ const resultsResponse = await fetch ( info . url ) ;
158+ previousBuildResults = await resultsResponse . json ( ) ;
158159break ;
159160}
160161}
@@ -163,14 +164,13 @@ function git(args) {
163164return ;
164165}
165166
166- if ( resultsResponse === null ) {
167+ if ( previousBuildResults === null ) {
167168warn ( `Could not find build artifacts for base commit: ${ baseCommit } ` ) ;
168169return ;
169170}
170171
171172// Take the JSON of the build response and
172173// make an array comparing the results for printing
173- const previousBuildResults = await resultsResponse . json ( ) ;
174174const results = generateResultsArray (
175175currentBuildResults ,
176176previousBuildResults
0 commit comments