File tree Expand file tree Collapse file tree 1 file changed +27
-7
lines changed
Plugins/Flow.Launcher.Plugin.Program Expand file tree Collapse file tree 1 file changed +27
-7
lines changed Original file line number Diff line number Diff line change @@ -193,26 +193,46 @@ await Stopwatch.NormalAsync("|Flow.Launcher.Plugin.Program.Main|Preload programs
193
193
{
194
194
Helper . ValidateDirectory ( Context . CurrentPluginMetadata . PluginCacheDirectoryPath ) ;
195
195
196
- static bool MoveFile ( string sourcePath , string destinationPath )
196
+ static void MoveFile ( string sourcePath , string destinationPath )
197
197
{
198
198
if ( ! File . Exists ( sourcePath ) )
199
199
{
200
- return false ;
200
+ return ;
201
201
}
202
202
203
203
if ( File . Exists ( destinationPath ) )
204
204
{
205
- File . Delete ( sourcePath ) ;
206
- return false ;
205
+ try
206
+ {
207
+ File . Delete ( sourcePath ) ;
208
+ }
209
+ catch ( Exception )
210
+ {
211
+ // Ignore, we will handle next time we start the plugin
212
+ }
213
+ return ;
207
214
}
208
215
209
216
var destinationDirectory = Path . GetDirectoryName ( destinationPath ) ;
210
217
if ( ! Directory . Exists ( destinationDirectory ) && ( ! string . IsNullOrEmpty ( destinationDirectory ) ) )
211
218
{
212
- Directory . CreateDirectory ( destinationDirectory ) ;
219
+ try
220
+ {
221
+ Directory . CreateDirectory ( destinationDirectory ) ;
222
+ }
223
+ catch ( Exception )
224
+ {
225
+ // Ignore, we will handle next time we start the plugin
226
+ }
227
+ }
228
+ try
229
+ {
230
+ File . Move ( sourcePath , destinationPath ) ;
231
+ }
232
+ catch ( Exception )
233
+ {
234
+ // Ignore, we will handle next time we start the plugin
213
235
}
214
- File . Move ( sourcePath , destinationPath ) ;
215
- return true ;
216
236
}
217
237
218
238
// Move old cache files to the new cache directory
You can’t perform that action at this time.
0 commit comments