#!/bin/bash
XDG_CONFIG_HOME=${XDG_CONFIG_HOME:-~/.config}
FLAT_FILE=${XDG_CONFIG_HOME}/cherry-studio-flags.conf

# Allow users to override command-line options
if [[ -f ${FLAT_FILE} ]]; then
    mapfile -t _USER_FLAGS < <(sed 's/#.*//' "${FLAT_FILE}" | tr '\n' ' ')
fi

exec /usr/bin/electron41 /usr/lib/cherry-studio/app.asar "" "${_USER_FLAGS[@]}"
