File tree Expand file tree Collapse file tree 1 file changed +7
-17
lines changed Expand file tree Collapse file tree 1 file changed +7
-17
lines changed Original file line number Diff line number Diff line change @@ -10,23 +10,13 @@ const gitForWindowsUsrBinPath = 'C:/Program Files/Git/usr/bin'
10
10
const gitForWindowsMINGW64BinPath = 'C:/Program Files/Git/mingw64/bin'
11
11
12
12
async function fetchJSONFromURL < T > ( url : string ) : Promise < T > {
13
- return new Promise < T > ( async ( resolve , reject ) => {
14
- try {
15
- const res = await fetch ( url )
16
- if ( res . status !== 200 ) {
17
- reject (
18
- new Error (
19
- `Got code ${ res . status } , URL: ${ url } , message: ${ res . statusText } `
20
- )
21
- )
22
- return
23
- }
24
-
25
- resolve ( res . json ( ) )
26
- } catch ( e ) {
27
- reject ( e )
28
- }
29
- } )
13
+ const res = await fetch ( url )
14
+ if ( res . status !== 200 ) {
15
+ throw new Error (
16
+ `Got code ${ res . status } , URL: ${ url } , message: ${ res . statusText } `
17
+ )
18
+ }
19
+ return res . json ( )
30
20
}
31
21
32
22
function mkdirp ( directoryPath : string ) : void {
You can’t perform that action at this time.
0 commit comments