File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -2560,6 +2560,19 @@ std::string FileSystem::GetProgramPath()
2560
2560
#endif
2561
2561
}
2562
2562
2563
+ std::string FileSystem::GetPackagePath ()
2564
+ {
2565
+ // Check if we are running inside appimage. If so, return the path to the appimage instead.
2566
+ if (const char * appimage_path = getenv (" APPIMAGE" ))
2567
+ return std::string (appimage_path);
2568
+
2569
+ // TODO: Can probably be expanded to look for Flatpak too
2570
+
2571
+ // Otherwise, find the executable using `GetProgramPath()`
2572
+
2573
+ return GetProgramPath ();
2574
+ }
2575
+
2563
2576
std::string FileSystem::GetWorkingDirectory ()
2564
2577
{
2565
2578
std::string buffer;
Original file line number Diff line number Diff line change @@ -169,6 +169,10 @@ namespace FileSystem
169
169
// / Returns the path to the current executable.
170
170
std::string GetProgramPath ();
171
171
172
+
173
+ // / Returns the path to the current package (Linux AppImage).
174
+ std::string GetPackagePath ();
175
+
172
176
// / Retrieves the current working directory.
173
177
std::string GetWorkingDirectory ();
174
178
You can’t perform that action at this time.
0 commit comments