Ensure that custom AppRun are deployed even if no desktop files are found

This commit is contained in:
Alexis Lopez Zubieta
2018-11-06 07:48:12 -06:00
parent 9f20e5829d
commit 9d78e0786b
2 changed files with 13 additions and 0 deletions

View File

@@ -57,6 +57,12 @@ namespace linuxdeploy {
std::string customAppRunPath, appdir::AppDir& appDir) {
ldLog() << std::endl << "-- Deploying files into AppDir root directory --" << std::endl;
if (!customAppRunPath.empty()) {
ldLog() << LD_WARNING << "Deploying custom AppRun: " << customAppRunPath << std::endl;
appDir.deployFile(customAppRunPath, appDir.path() / "AppRun");
appDir.executeDeferredOperations();
}
auto deployedDesktopFiles = appDir.deployedDesktopFiles();
if (deployedDesktopFiles.empty()) {
ldLog() << LD_WARNING << "Could not find desktop file in AppDir, cannot create links for AppRun, "

View File

@@ -89,4 +89,11 @@ namespace LinuxDeployTest {
ASSERT_TRUE(exists(tmpAppDir / source_icon_path.filename()));
ASSERT_TRUE(exists(target_apprun_path));
}
TEST_F(LinuxDeployTestsFixture, deployAppDirRootFilesWithCustomAppRun) {
linuxdeploy::core::appdir::AppDir appDir(tmpAppDir);
linuxdeploy::deployAppDirRootFiles({}, source_apprun_path.string(), appDir);
ASSERT_TRUE(exists(target_apprun_path));
}
}