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 ({
56
56
debug,
57
57
backupDir = DEFAULT_BACKUP_DIR ,
58
58
} : CollectFilesOptions ) : Promise < FileEntry [ ] > => {
59
+ // delete backupDir during initialization
60
+ try {
61
+ await fs . rm ( backupDir , { recursive : true , force : true } ) ;
62
+ } catch {
63
+ // ignore
64
+ }
59
65
for ( const p of [ ...include , ...exclude ] ) {
60
66
if ( p . startsWith ( "!" ) ) throw new Error ( `Negation not allowed in include/exclude: ${ p } ` ) ;
61
67
if ( p . includes ( "\\" ) ) console . warn ( `Use '/' as path separator: ${ p } ` ) ;
62
68
}
63
69
64
- exclude . push ( backupDir ) ;
70
+ exclude . push ( ` ${ backupDir } /**` ) ;
65
71
66
72
const fileMatcher = ( filepath : string ) => {
67
73
const posixPath = filepath . replace ( / \\ / g, "/" ) ;
You can’t perform that action at this time.
0 commit comments