@@ -303,7 +303,7 @@ function createGlobalStateMachine() {
303
303
304
304
// Clone repo
305
305
// This could take awhile if the repo is large
306
- console . log ( `$ git clone ${ url } .git ${ ROOT_DIR } ` )
306
+ console . time ( `$ git clone ${ url } .git ${ ROOT_DIR } ` )
307
307
await git . clone ( {
308
308
fs,
309
309
http,
@@ -316,6 +316,7 @@ function createGlobalStateMachine() {
316
316
onMessage : console . log ,
317
317
onAuth : ( ) => ( { username, password : token } ) ,
318
318
} )
319
+ console . timeEnd ( `$ git clone ${ url } .git ${ ROOT_DIR } ` )
319
320
320
321
// Set user in git config
321
322
console . log ( `$ git config user.name "Cole Bemis"` )
@@ -345,23 +346,24 @@ function createGlobalStateMachine() {
345
346
346
347
const { username, token } = context . githubUser
347
348
348
- console . log ( `$ git pull` )
349
+ console . time ( `$ git pull` )
349
350
await git . pull ( {
350
351
fs,
351
352
http,
352
353
dir : ROOT_DIR ,
353
354
singleBranch : true ,
354
- onMessage : console . log ,
355
355
onAuth : ( ) => ( { username, password : token } ) ,
356
356
} )
357
+ console . timeEnd ( `$ git pull` )
357
358
358
- console . log ( `$ git push` )
359
+ console . time ( `$ git push` )
359
360
await git . push ( {
360
361
fs,
361
362
http,
362
363
dir : ROOT_DIR ,
363
364
onAuth : ( ) => ( { username, password : token } ) ,
364
365
} )
366
+ console . timeEnd ( `$ git push` )
365
367
366
368
const markdownFiles = await getMarkdownFilesFromFs ( ROOT_DIR )
367
369
@@ -397,13 +399,14 @@ function createGlobalStateMachine() {
397
399
398
400
// Push if online
399
401
if ( navigator . onLine ) {
400
- console . log ( `$ git push` )
402
+ console . time ( `$ git push` )
401
403
await git . push ( {
402
404
fs,
403
405
http,
404
406
dir : ROOT_DIR ,
405
407
onAuth : ( ) => ( { username, password : token } ) ,
406
408
} )
409
+ console . timeEnd ( `$ git push` )
407
410
}
408
411
} ,
409
412
deleteFile : async ( context , event ) => {
@@ -436,13 +439,14 @@ function createGlobalStateMachine() {
436
439
437
440
// Push if online
438
441
if ( navigator . onLine ) {
439
- console . log ( `$ git push` )
442
+ console . time ( `$ git push` )
440
443
await git . push ( {
441
444
fs,
442
445
http,
443
446
dir : ROOT_DIR ,
444
447
onAuth : ( ) => ( { username, password : token } ) ,
445
448
} )
449
+ console . timeEnd ( `$ git push` )
446
450
}
447
451
} ,
448
452
} ,
@@ -522,7 +526,6 @@ function getMarkdownFilesFromLocalStorage() {
522
526
/** Walk the file system and return the contents of all markdown files */
523
527
async function getMarkdownFilesFromFs ( dir : string ) {
524
528
console . time ( "getMarkdownFilesFromFs()" )
525
-
526
529
const markdownFiles = await git . walk ( {
527
530
fs,
528
531
dir,
@@ -542,7 +545,6 @@ async function getMarkdownFilesFromFs(dir: string) {
542
545
return [ filepath , new TextDecoder ( ) . decode ( content ) ]
543
546
} ,
544
547
} )
545
-
546
548
console . timeEnd ( "getMarkdownFilesFromFs()" )
547
549
548
550
return Object . fromEntries ( markdownFiles )
0 commit comments