#!/bin/sh
# publisher launcher: the config lives in ~/.config/publisher/publish.toml (copied from the example on the first run).
cfg=${XDG_CONFIG_HOME:-$HOME/.config}/publisher/publish.toml
if [ ! -f "$cfg" ]; then
	mkdir -p "${cfg%/*}" && cp /usr/share/das/publisher/publish.toml.example "$cfg" || exit 1
	echo "publish: created $cfg, edit [server] there" >&2
fi
PYTHONPATH=/usr/lib/das/publisher exec python3 -c 'import sys; from publisher.cli import main; sys.exit(main())' --config "$cfg" "$@"
