@@ -32,15 +32,15 @@ const {generateResultsArray} = require('./scripts/rollup/stats');
32
32
const { existsSync, readFileSync} = require ( 'fs' ) ;
33
33
const { exec} = require ( 'child_process' ) ;
34
34
35
- if ( ! existsSync ( './scripts/rollup/results .json' ) ) {
35
+ if ( ! existsSync ( './build/bundle-sizes .json' ) ) {
36
36
// This indicates the build failed previously.
37
37
// In that case, there's nothing for the Dangerfile to do.
38
38
// Exit early to avoid leaving a redundant (and potentially confusing) PR comment.
39
39
process . exit ( 0 ) ;
40
40
}
41
41
42
42
const currentBuildResults = JSON . parse (
43
- readFileSync ( './scripts/rollup/results .json' )
43
+ readFileSync ( './build/bundle-sizes .json' )
44
44
) ;
45
45
46
46
/**
@@ -118,7 +118,7 @@ function git(args) {
118
118
await git ( 'fetch upstream' ) ;
119
119
const baseCommit = await git ( `merge-base HEAD upstream/${ upstreamRef } ` ) ;
120
120
121
- let resultsResponse = null ;
121
+ let previousBuildResults = null ;
122
122
try {
123
123
let baseCIBuildId = null ;
124
124
const statusesResponse = await fetch (
@@ -153,8 +153,9 @@ function git(args) {
153
153
154
154
for ( let i = 0 ; i < baseArtifactsInfo . length ; i ++ ) {
155
155
const 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 ( ) ;
158
159
break ;
159
160
}
160
161
}
@@ -163,14 +164,13 @@ function git(args) {
163
164
return ;
164
165
}
165
166
166
- if ( resultsResponse === null ) {
167
+ if ( previousBuildResults === null ) {
167
168
warn ( `Could not find build artifacts for base commit: ${ baseCommit } ` ) ;
168
169
return ;
169
170
}
170
171
171
172
// Take the JSON of the build response and
172
173
// make an array comparing the results for printing
173
- const previousBuildResults = await resultsResponse . json ( ) ;
174
174
const results = generateResultsArray (
175
175
currentBuildResults ,
176
176
previousBuildResults
0 commit comments