@@ -54,17 +54,17 @@ async function main() {
54
54
55
55
const outputdir = await makeTempdir ( ) ;
56
56
const outputGIF = `${ outputdir } /output.gif` ;
57
- await pngFileStream ( `${ tempdir } /T*.png` )
57
+ pngFileStream ( `${ tempdir } /T*.png` )
58
58
. pipe ( encoder . createWriteStream ( { repeat : 0 , delay : 200 , quality : 50 } ) )
59
- . pipe ( fs . createWriteStream ( outputGIF ) ) ;
60
- console . log ( `Created session GIF: ${ outputGIF } ` ) ;
61
- await delay ( 5000 ) ;
62
- execSync ( `ls -lhta ${ outputdir } ` , { stdio : [ 0 , 1 , 2 ] } ) ;
63
-
64
- if ( process . env . CI && process . env . SURGE_LOGIN && process . env . SURGE_TOKEN ) {
65
- console . log ( 'Uploading GIF to: http:// commit-sudoku.surge.sh/output.gif' ) ;
66
- execSync ( `SURGE_TOKEN= ${ process . env . SURGE_TOKEN } npx surge ${ outputdir } commit-sudoku.surge.sh` , { stdio : [ 0 , 1 , 2 ] } ) ;
67
- }
59
+ . pipe ( fs . createWriteStream ( outputGIF ) )
60
+ . on ( 'close' , ( ) => {
61
+ console . log ( `Created session GIF: ${ outputGIF } ` ) ;
62
+ execSync ( `ls -lhta ${ outputdir } ` , { stdio : [ 0 , 1 , 2 ] } ) ;
63
+ if ( process . env . CI && process . env . SURGE_LOGIN && process . env . SURGE_TOKEN ) {
64
+ console . log ( 'Uploading GIF to: http://commit-sudoku.surge.sh/output.gif' ) ;
65
+ execSync ( `SURGE_TOKEN= ${ process . env . SURGE_TOKEN } npx surge ${ outputdir } commit-sudoku.surge.sh` , { stdio : [ 0 , 1 , 2 ] } ) ;
66
+ }
67
+ } ) ;
68
68
}
69
69
70
70
function getTableStateForCommit ( commitSHA ) {
0 commit comments