Skip to content

Commit

Permalink
fuck windoz
Browse files Browse the repository at this point in the history
  • Loading branch information
TheLastGimbus committed Apr 2, 2023
1 parent 009122f commit 44a5a48
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/moving.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ File findNotExistingName(File initialFile) {
/// This will create symlink on unix and shortcut on windoza
///
/// Uses [findNotExistingName] for safety
///
/// WARN: Crashes with non-ascii names :(
Future<File> createShortcut(Directory location, File target) async {
final name = '${p.basename(target.path)}${Platform.isWindows ? '.lnk' : ''}';
final link = findNotExistingName(File(p.join(location.path, name)));
Expand Down Expand Up @@ -141,7 +143,7 @@ Stream<int> moveFiles(
// in case powershell fails/whatever
print('Creating shortcut for '
'${p.basename(mainFile.path)} in ${p.basename(folder.path)} '
'failed :( - coping normal file instead');
'failed :(\n$e\n - coping normal file instead');
result = await moveFile();
}
} else {
Expand Down

0 comments on commit 44a5a48

Please sign in to comment.