File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,11 @@ impl CSharpPlugin {
3838 fn runner_needs_to_be_extracted ( target : & Path ) -> Result < bool , CSharpError > {
3939 log:: debug!( "verifying C# runner integrity at {}" , target. display( ) ) ;
4040
41+ // no need to check the zip contents if the directory doesn't even exist
42+ if !target. exists ( ) {
43+ return Ok ( true ) ;
44+ }
45+
4146 let mut zip = ZipArchive :: new ( Cursor :: new ( TMC_CSHARP_RUNNER ) ) ?;
4247 for i in 0 ..zip. len ( ) {
4348 let file = zip. by_index ( i) ?;
@@ -95,7 +100,10 @@ impl CSharpPlugin {
95100 Some ( cache_dir) => {
96101 let runner_dir = cache_dir. join ( "tmc" ) . join ( "tmc-csharp-runner" ) ;
97102 if Self :: runner_needs_to_be_extracted ( & runner_dir) ? {
98- file_util:: remove_dir_all ( & runner_dir) ?;
103+ if runner_dir. exists ( ) {
104+ // clear the directory if it exists
105+ file_util:: remove_dir_all ( & runner_dir) ?;
106+ }
99107 Self :: extract_runner_to_dir ( & runner_dir) ?;
100108 }
101109 Ok ( runner_dir)
You can’t perform that action at this time.
0 commit comments