Skip to content

Commit 9095ece

Browse files
committed
Allow users to require signing
Currently, if signing fails, appimagetool just reports the error but continues to build the AppImage. This is not ideal for automated environments which want to make sure the resulting AppImages have been signed correctly. This commit adds support for the APPIMAGETOOL_FORCE_SIGN environment variable, which makes appimagetool abort in case signing fails.
1 parent 054e547 commit 9095ece

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/appimagetool.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1232,9 +1232,16 @@ main (int argc, char *argv[])
12321232
}
12331233

12341234
if (!g_subprocess_wait_check(sign_proc, NULL, &error)) {
1235-
fprintf(stderr, "ERROR: %s command did not succeed, could not sign (%s), continuing\n",
1236-
using_gpg ? "gpg" : "gpg2", error->message);
12371235
g_object_unref(sign_proc);
1236+
1237+
if (getenv("APPIMAGETOOL_FORCE_SIGN") != NULL) {
1238+
fprintf(stderr, "ERROR: %s command did not succeed, could not sign (%s), aborting\n",
1239+
using_gpg ? "gpg" : "gpg2", error->message);
1240+
exit(1);
1241+
} else {
1242+
fprintf(stderr, "ERROR: %s command did not succeed, could not sign (%s), continuing\n",
1243+
using_gpg ? "gpg" : "gpg2", error->message);
1244+
}
12381245
} else {
12391246
g_object_unref(sign_proc);
12401247

0 commit comments

Comments
 (0)