File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -30,11 +30,17 @@ async function getArchive(folderPath) {
3030 const packNext = await archive . getPack ( ) ;
3131 const changed = [ ] ;
3232 for ( const fileName in packPrev ) {
33+ if ( fileName . includes ( ".prettier-caches" ) ) continue ;
3334 const filePrev = packPrev [ fileName ] ;
3435 const fileNext = packNext [ fileName ] ;
3536 if ( filePrev . contents === fileNext . contents ) continue ;
3637 changed . push ( fileName ) ;
3738 }
39+ for ( const fileName in packNext ) {
40+ if ( fileName . includes ( ".prettier-caches" ) ) continue ;
41+ if ( packPrev [ fileName ] ) continue ;
42+ changed . push ( fileName ) ;
43+ }
3844 return changed ;
3945 } ) ,
4046 getDiff : async ( ) => {
@@ -55,7 +61,11 @@ async function getArchive(folderPath) {
5561 for ( const fileName of changed ) {
5662 const filePath = path . join ( folderPath , fileName ) ;
5763 const filePrev = packPrev [ fileName ] ;
58- await fs . writeFile ( filePath , filePrev . contents , filePrev . encoding ) ;
64+ if ( filePrev ) {
65+ await fs . writeFile ( filePath , filePrev . contents , filePrev . encoding ) ;
66+ } else {
67+ await fs . rm ( filePath ) ;
68+ }
5969 }
6070 } ,
6171 } ;
You can’t perform that action at this time.
0 commit comments