File tree Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Expand file tree Collapse file tree 1 file changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -187,7 +187,7 @@ async function runDocker(datasource, opts) {
187
187
} catch ( error ) {
188
188
print . info ( 'A problem occurred while reading matchstick.yaml. Please attend to the errors below:' )
189
189
print . error ( error . message )
190
- return
190
+ process . exit ( 1 )
191
191
}
192
192
}
193
193
@@ -252,17 +252,26 @@ async function runDocker(datasource, opts) {
252
252
// Downloads Dockerfile template from the demo-subgraph repo
253
253
// Replaces the placeholders with their respective values
254
254
async function dockerfile ( dockerfilePath , versionOpt , latestVersion ) {
255
- let result = await fetch ( 'https://raw.githubusercontent.com/LimeChain/demo-subgraph/main/Dockerfile' )
256
- let content = await result . text ( )
255
+ let content = await fetch ( 'https://raw.githubusercontent.com/LimeChain/demo-subgraph/main/Dockerfile' )
256
+ . then ( ( response ) => {
257
+ if ( response . ok ) {
258
+ return response . text ( )
259
+ } else {
260
+ print . error ( 'A problem occurred while downloading the Dockerfile template:' )
261
+ print . error ( `Status Code: ${ response . status } , with error: ${ response . statusText } ` )
262
+ process . exit ( 1 )
263
+ }
264
+ } )
265
+
257
266
258
267
// Create the Dockerfile
259
268
try {
260
269
await filesystem . write ( dockerfilePath , content )
261
270
print . info ( 'Successfully generated Dockerfile.' )
262
271
} catch ( error ) {
263
- print . info ( 'A problem occurred while generating the Dockerfile. Please attend to the errors below:' )
272
+ print . error ( 'A problem occurred while generating the Dockerfile. Please attend to the errors below:' )
264
273
print . error ( error . message )
265
- return
274
+ process . exit ( 1 )
266
275
}
267
276
268
277
await patching . update ( dockerfilePath , data => {
You can’t perform that action at this time.
0 commit comments