File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ test/fixtures/bar
77test /fixtures /contains-cycle /symlink2
88test /fixtures /contains-cycle /is-cycle
99.vscode /
10- ** /* .js
11- ** /* .d.ts
10+ * .js
11+ * .d.ts
12+ * .js.map
1213! test /fixture
13- index.js.map
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -34,15 +34,28 @@ function safeUnlink(path:string) {
3434 }
3535}
3636
37+ function safeRmdir ( path :string ) {
38+ try {
39+ fs . rmdirSync ( path ) ;
40+ } catch ( e ) {
41+ if ( typeof e === 'object' && e !== null && ( e . code === 'ENOENT' || e . code === 'ENOTDIR' ) ) {
42+ // handle
43+ } else {
44+ throw e ;
45+ }
46+ }
47+ }
48+
3749symlink ( './some-other-dir' , 'test/fixtures/symlink1' ) ;
3850symlink ( 'doesnotexist' , 'test/fixtures/symlink2' , true ) ;
3951
52+ // https://github.com/joliss/node-walk-sync/pull/44
53+ safeRmdir ( __dirname + '/fixtures/bar' ) ;
4054safeUnlink ( __dirname + '/fixtures/bar' ) ;
4155safeUnlink ( __dirname + '/fixtures/symlink3' ) ;
42-
43- fs . mkdirSync ( './bar' ) ;
44- symlink ( './bar/' , 'test/fixtures/symlink3' , true ) ;
45- fs . rmdirSync ( './bar' ) ;
56+ // Create a broken link to a directory ...
57+ symlink ( 'bar' , __dirname + '/fixtures/symlink3' , true ) ;
58+ // ... and copy a file in its place
4659fs . copyFileSync ( __dirname + '/fixtures/dir/bar.txt' , __dirname + '/fixtures/bar' ) ;
4760
4861safeUnlink ( __dirname + '/fixtures/contains-cycle/is-cycle' ) ;
Original file line number Diff line number Diff line change 55 "moduleResolution" : " node" ,
66 "module" : " commonjs" ,
77 "target" : " es2017" ,
8- "sourceMap" : true ,
9- "strict" : true
8+ "sourceMap" : true
109 },
1110 "exclude" : [" index.d.ts" ],
1211 "include" : [" index.ts" , " test/test.ts" ]
You can’t perform that action at this time.
0 commit comments