From 55aeda326a8a845fb3b68b1dd7bd97d9d3fbf052 Mon Sep 17 00:00:00 2001 From: TheLastGimbus Date: Sun, 2 Apr 2023 16:52:10 +0200 Subject: [PATCH] don't fail together with powershell --- lib/moving.dart | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/moving.dart b/lib/moving.dart index b79a7a69..1b60e0df 100644 --- a/lib/moving.dart +++ b/lib/moving.dart @@ -135,7 +135,15 @@ Stream 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)