#!/bin/sh
set -e

mkdir -p "$HOME/.local/bin"
ln -sfn "$PWD/bin/wiki-notify-gchat" "$HOME/.local/bin/wiki-notify-gchat" 2>/dev/null || cp "$PWD/bin/wiki-notify-gchat" "$HOME/.local/bin/wiki-notify-gchat"
chmod +x "$PWD/bin/wiki-notify-gchat"

echo "OK: wiki-notify-gchat installed at ~/.local/bin/wiki-notify-gchat"
echo "Hint: run \`wiki-notify-gchat setup\`, create YOUR OWN Chat space + incoming webhook, paste it into the config."
echo "Hint: wiki-notify-gchat needs an authorized adom-google (run \`adom-google status\` to check)."
