From b1f3506c3605f815b40ebb09add8d6d91e40bd7a Mon Sep 17 00:00:00 2001 From: probonopd Date: Mon, 10 Oct 2016 19:05:34 +0200 Subject: [PATCH] Exit with error code if AppImage generation fails --- linuxdeployqt/main.cpp | 5 ++++- shared/shared.cpp | 3 ++- shared/shared.h | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/linuxdeployqt/main.cpp b/linuxdeployqt/main.cpp index 3e2d81c..f0644cf 100644 --- a/linuxdeployqt/main.cpp +++ b/linuxdeployqt/main.cpp @@ -207,7 +207,10 @@ int main(int argc, char **argv) stripAppBinary(appDirPath); if (appimage) { - createAppImage(appDirPath); + int result = createAppImage(appDirPath); + if(result =! 0){ + exit(result); + } } return 0; diff --git a/shared/shared.cpp b/shared/shared.cpp index 5ddac2d..b689798 100644 --- a/shared/shared.cpp +++ b/shared/shared.cpp @@ -1110,7 +1110,7 @@ bool checkAppImagePrerequisites(const QString &appDirPath) return true; } -void createAppImage(const QString &appDirPath) +int createAppImage(const QString &appDirPath) { QString appImagePath = appDirPath + ".AppImage"; @@ -1129,4 +1129,5 @@ void createAppImage(const QString &appDirPath) } QString appImageCommand = "AppImageAssistant '" + appDirPath +"' '" + appImagePath + "'"; int ret = system(appImageCommand.toUtf8().constData()); + return ret; } diff --git a/shared/shared.h b/shared/shared.h index 15aa249..60c0fd9 100644 --- a/shared/shared.h +++ b/shared/shared.h @@ -120,7 +120,7 @@ void runStrip(const QString &binaryPath); void stripAppBinary(const QString &bundlePath); QString findAppBinary(const QString &appDirPath); QStringList findAppLibraries(const QString &appDirPath); -void createAppImage(const QString &appBundlePath); +int createAppImage(const QString &appBundlePath); bool checkAppImagePrerequisites(const QString &appBundlePath); #endif