#!/bin/sh

if test "$1" = "classic"; then
    shift
    case $SNAP_ARCH in
        amd64)
            TRIPLET="x86_64-linux-gnu"
            ;;
        armhf)
            TRIPLET="arm-linux-gnueabihf"
            ;;
        arm64)
            TRIPLET="aarch64-linux-gnu"
            ;;
        *)
            TRIPLET="$(uname -p)-linux-gnu"
            ;;
    esac

    export LD_LIBRARY_PATH=$SNAP/usr/lib:$SNAP/usr/lib/$TRIPLET:$SNAP/lib/$TRIPLET
fi

exec ${SNAP}/bin/desktop-launch $@