Skip to content

Commit

Permalink
fix(integration): resolve desktop file before moving; handle bad desk…
Browse files Browse the repository at this point in the history
…top file in disintegrate
  • Loading branch information
tdiam committed Oct 22, 2023
1 parent fddb8f5 commit c207269
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/src/features/home/data/appimage_tools_repository.dart
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class AppimageToolsRepository {
.listSync()
.firstWhere((element) => p.extension(element.path) == ".desktop");
await desktopFile
.moveFile(_localPathService.applicationsDir + desktopfilename);
.moveResolvedFile(_localPathService.applicationsDir + desktopfilename);
String execPath = (await Process.run(
"grep",
[
Expand Down Expand Up @@ -150,7 +150,7 @@ class AppimageToolsRepository {
FileSystemEntity file,
) async {
// Delete Icons
String iconName = (await Process.run(
String? iconName = (await Process.run(
"grep",
[
"^Icon=",
Expand All @@ -160,8 +160,9 @@ class AppimageToolsRepository {
workingDirectory: _localPathService.applicationsDir,
))
.stdout
.split("=")[1]
.trim();
.split("=")
.elementAtOrNull(1)
?.trim();
for (var icon
in Directory(_localPathService.iconsDir).listSync(recursive: true)) {
if (p.basenameWithoutExtension(icon.path) == iconName) {
Expand Down

0 comments on commit c207269

Please sign in to comment.