File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ---
Original file line number Diff line number Diff line change @@ -56,12 +56,18 @@ export const listMatchingFiles = async ({
5656 debug,
5757 backupDir = DEFAULT_BACKUP_DIR ,
5858} : CollectFilesOptions ) : Promise < FileEntry [ ] > => {
59+ // delete backupDir during initialization
60+ try {
61+ await fs . rm ( backupDir , { recursive : true , force : true } ) ;
62+ } catch {
63+ // ignore
64+ }
5965 for ( const p of [ ...include , ...exclude ] ) {
6066 if ( p . startsWith ( "!" ) ) throw new Error ( `Negation not allowed in include/exclude: ${ p } ` ) ;
6167 if ( p . includes ( "\\" ) ) console . warn ( `Use '/' as path separator: ${ p } ` ) ;
6268 }
6369
64- exclude . push ( backupDir ) ;
70+ exclude . push ( ` ${ backupDir } /**` ) ;
6571
6672 const fileMatcher = ( filepath : string ) => {
6773 const posixPath = filepath . replace ( / \\ / g, "/" ) ;
You can’t perform that action at this time.
0 commit comments