Skip to content

Commit

Permalink
don't fail together with powershell
Browse files Browse the repository at this point in the history
  • Loading branch information
TheLastGimbus committed Apr 2, 2023
1 parent 3b0c30d commit 55aeda3
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/moving.dart
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,15 @@ Stream<int> moveFiles(
result = await moveFile();
mainFile = result;
} else if (albumBehavior == 'shortcut' && mainFile != null) {
result = await createShortcut(folder, mainFile);
try {
result = await createShortcut(folder, mainFile);
} catch (e) {
// in case powershell fails/whatever
print('Creating shortcut for '
'${p.basename(mainFile.path)} in ${p.basename(folder.path)} '
'failed :( - coping normal file instead');
result = await moveFile();
}
} else {
// else - if we either run duplicate-copy or main file is missing:
// (this happens with archive/trash/weird situation)
Expand Down

0 comments on commit 55aeda3

Please sign in to comment.