Skip to content

Commit 2f7ad20

Browse files
committed
Don't overwrite existing AppRun
... unless custom AppRun was specified
1 parent 485507a commit 2f7ad20

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

src/main.cpp

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,7 @@ int main(int argc, char** argv) {
172172
auto retcode = plugin->run(appDir.path());
173173

174174
if (retcode != 0) {
175-
ldLog() << LD_ERROR << "Failed to run plugin:" << pluginName << std::endl;
176-
ldLog() << LD_DEBUG << "Exited with return code:" << retcode << std::endl;
175+
ldLog() << LD_ERROR << "Failed to run plugin:" << pluginName << "(exit code:" << retcode << LD_NO_SPACE << ")" << std::endl;
177176
return 1;
178177
}
179178
}
@@ -250,9 +249,14 @@ int main(int argc, char** argv) {
250249
}
251250

252251
// search for desktop file and deploy it to AppDir root
253-
{
254-
ldLog() << std::endl << "-- Deploying files into AppDir root directory --" << std::endl;
255-
252+
ldLog() << std::endl << "-- Deploying files into AppDir root directory --" << std::endl;
253+
254+
if (bf::is_regular_file(appDir.path() / "AppRun")) {
255+
if (customAppRunPath)
256+
ldLog() << LD_WARNING << "AppRun exists but custom AppRun specified, overwriting existing AppRun" << std::endl;
257+
else
258+
ldLog() << LD_WARNING << "AppRun exists, skipping deployment" << std::endl;
259+
} else {
256260
auto deployedDesktopFiles = appDir.deployedDesktopFiles();
257261

258262
desktopfile::DesktopFile desktopFile;

0 commit comments

Comments
 (0)