#!/bin/sh # Entry point of the albedo AppImage. Run as the CLI by default. The CLI starts # the daemon by running this AppImage again (ALBEDO_DAEMON=$APPIMAGE) with # ALBEDO_APPIMAGE_DAEMON=1, so the daemon holds its own mount of the image and # keeps its files after the CLI that started it exits. The image path stays # the same across upgrades, so ALBEDO_BUILD names the version. set -eu HERE="$(dirname "$(readlink -f "$0")")" export ALBEDO_BUILD="${ALBEDO_BUILD:-albedo-appimage-@VERSION@}" if [ "${ALBEDO_APPIMAGE_DAEMON:-}" = 1 ]; then unset ALBEDO_APPIMAGE_DAEMON exec "$HERE/bin/albedo-daemon" "$@" fi if [ -z "${APPIMAGE:-}" ]; then echo "albedo: run the .AppImage file itself, not AppRun" >&2 exit 1 fi export ALBEDO_DAEMON="$APPIMAGE" ALBEDO_APPIMAGE_DAEMON=1 ALBEDO_WEB_DIST="${ALBEDO_WEB_DIST:-$HERE/web}" exec "$HERE/bin/albedo" "$@"