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