arch-packages/discord-launcher.sh
Zoddo 5505d9db4a
discord 0.0.31-2: correctly pack all files, move resources to a subdirectory
Resources are moved to a "resources" subdirectory to allow automated asar
installers to work with this package.

Reported-by: irisnk (https://aur.archlinux.org/packages/discord_arch_electron#comment-937014)
2023-10-06 20:25:07 +02:00

21 lines
453 B
Bash
Executable file

#!/usr/bin/bash
set -euo pipefail
name=@PKGNAME@
electron=@ELECTRON@
flags_file="${XDG_CONFIG_HOME:-$HOME/.config}/${name}-flags.conf"
declare -a flags
if [[ -f "${flags_file}" ]]; then
mapfile -t < "${flags_file}"
fi
for line in "${MAPFILE[@]}"; do
if [[ ! "${line}" =~ ^[[:space:]]*#.* ]] && [[ -n "${line}" ]]; then
flags+=("${line}")
fi
done
exec /usr/bin/${electron} /usr/lib/${name}/resources/app.asar "${flags[@]}" "$@"