@@ -6,9 +6,6 @@ const buildContent = require('./buildContent');
6
6
const { loadJsonOrYaml, isJsonString} = require ( "./util" ) ;
7
7
8
8
function run ( url , body , cliOpts ) {
9
- if ( cliOpts ?. verbose ) {
10
- console . log ( "url: " + url )
11
- }
12
9
const apiUrl = url . replace ( / \/ $ / , '' )
13
10
let opts = { }
14
11
@@ -22,7 +19,7 @@ function run(url, body, cliOpts) {
22
19
// See: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch
23
20
fetch ( apiUrl , opts )
24
21
. then ( res => {
25
- console . log ( `status : ${ res . status } ${ res . statusText } ` )
22
+ console . log ( `Status : ${ res . status } ${ res . statusText } ` )
26
23
return res . json ( )
27
24
} )
28
25
. then ( json => {
@@ -33,11 +30,11 @@ function run(url, body, cliOpts) {
33
30
fs . mkdirSync ( path . dir , { recursive : true } )
34
31
fs . writeFile ( path . jsonFilePath , JSON . stringify ( json , null , "\t" ) , ( err ) => {
35
32
if ( err ) throw err ;
36
- console . log ( `saved : ${ path . jsonFilePath } ` )
33
+ console . log ( `Saved : ${ path . jsonFilePath } ` )
37
34
} ) ;
38
35
fs . writeFile ( path . goFilePath , content , ( err ) => {
39
36
if ( err ) throw err ;
40
- console . log ( `generated : ${ path . goFilePath } ` )
37
+ console . log ( `Generated : ${ path . goFilePath } ` )
41
38
} ) ;
42
39
} ) ;
43
40
}
0 commit comments