began making the client AppImage-aware
authorArt Cancro <ajc@citadel.org>
Wed, 7 Jul 2021 21:17:10 +0000 (17:17 -0400)
committerArt Cancro <ajc@citadel.org>
Wed, 7 Jul 2021 21:17:10 +0000 (17:17 -0400)
appimage/build_appimage.sh
textclient/commands.c

index 4fddec1a54083bd3769255e4acdddeafb41685db..db3f6b30b3e2de61370b7d9e052ae75187a82127 100755 (executable)
@@ -1,10 +1,15 @@
 #!/bin/bash
 
+# Work from the directory this script is in
+APPIMAGE_BUILD_DIR=$(dirname $(readlink -f $0))
+cd $APPIMAGE_BUILD_DIR || exit 28
+echo APPIMAGE_BUILD_DIR is `pwd`
+
+# Remove old versions
 rm -vf citadel-*appimage
 
 export CITADEL_BUILD_DIR=/tmp/citadel-build-$$
 export WEBCIT_BUILD_DIR=/tmp/webcit-build-$$
-rm -fr $CITADEL_BUILD_DIR $WEBCIT_BUILD_DIR
 
 # libcitadel has to be built in a "real" library directory
 pushd ../libcitadel || exit 1
index cecbb4d1fa5d073e3263848785db50d243afee46..81fef751a9bc017b1b6c4c499292f6df9ebe6e7d 100644 (file)
@@ -932,6 +932,10 @@ void load_command_set(void)
                snprintf(buf, sizeof buf, "%s/.citadelrc", getenv("HOME"));
                ccfile = fopen(buf, "r");
        }
+       if (getenv("APPDIR") != NULL) {
+               snprintf(buf, sizeof buf, "%s/citadel.rc", getenv("APPDIR"));
+               ccfile = fopen(buf, "r");
+       }
        if (ccfile == NULL) {
                ccfile = fopen(file_citadel_rc, "r");
        }