File tree Expand file tree Collapse file tree 1 file changed +10
-21
lines changed Expand file tree Collapse file tree 1 file changed +10
-21
lines changed Original file line number Diff line number Diff line change @@ -141,17 +141,6 @@ function getSketchContent(projectsInAllCategories) {
141141 } ) ) ) ) ;
142142}
143143
144- // a function to await for the response that contains the content of asset file
145- function doRequest ( options ) {
146- return new Promise ( ( ( resolve , reject ) => {
147- rp ( options ) . then ( ( response ) => {
148- resolve ( response ) ;
149- } ) . catch ( ( error ) => {
150- reject ( error ) ;
151- } ) ;
152- } ) ) ;
153- }
154-
155144function createProjectsInP5user ( projectsInAllCategories ) {
156145 const options = {
157146 url : 'https://api.github.com/repos/processing/p5.js-website/contents/src/data/examples/assets' ,
@@ -301,16 +290,16 @@ function createProjectsInP5user(projectsInAllCategories) {
301290 json : true
302291 } ;
303292
304- // // a function to await for the response that contains the content of asset file
305- // function doRequest(options ) {
306- // return new Promise(function ( resolve, reject) {
307- // rp(options ).then((response) => {
308- // resolve(response);
309- // }).catch((error) => {
310- // reject(error);
311- // })
312- // })
313- // }
293+ // a function to await for the response that contains the content of asset file
294+ const doRequest = function ( _options ) {
295+ return new Promise ( ( ( resolve , reject ) => {
296+ rp ( _options ) . then ( ( response ) => {
297+ resolve ( response ) ;
298+ } ) . catch ( ( error ) => {
299+ reject ( error ) ;
300+ } ) ;
301+ } ) ) ;
302+ } ;
314303
315304 assetContent = await doRequest ( assetOptions ) ;
316305 // push to the files array of the project only when response is received
You can’t perform that action at this time.
0 commit comments