Skip to content

Commit

Permalink
Merge pull request #113 from tdiam/tdiam/fix-symlinked-desktop
Browse files Browse the repository at this point in the history
Handle symlinked desktop files
  • Loading branch information
prateekmedia committed Oct 23, 2023
2 parents 42b3811 + e5c2a63 commit a7db55e
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions lib/src/features/home/data/appimage_tools_repository.dart
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,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 @@ -188,18 +188,22 @@ class AppimageToolsRepository {
FileSystemEntity file,
) async {
// Delete Icons
String iconName = (await Process.run(
"grep",
[
"^Icon=",
_localPathService.applicationsDir + content[index] + ".desktop",
],
runInShell: true,
workingDirectory: _localPathService.applicationsDir,
))
.stdout
.split("=")[1]
.trim();
String? iconName;
try {
iconName = (await Process.run(
"grep",
[
"^Icon=",
_localPathService.applicationsDir + content[index] + ".desktop",
],
runInShell: true,
workingDirectory: _localPathService.applicationsDir,
))
.stdout
.split("=")[1]
.trim();
} on RangeError {}

for (var icon
in Directory(_localPathService.iconsDir).listSync(recursive: true)) {
if (p.basenameWithoutExtension(icon.path) == iconName) {
Expand Down

0 comments on commit a7db55e

Please sign in to comment.