#!/bin/sh# Prepare bots by creating ./bots directory# Specify $COCKPIT_BOTS_REF to checkout non-main branchGITHUB_REPO='bots'SUBDIR='bots'# Cockpit plugins from different organizations are expected to share the same bots repositoryGITHUB_BASE="cockpit-project"V="${V-0}" # default to friendly messagesset -eucd "${0%/*}/../.."# shellcheck source-path=SCRIPTDIR/../... test/common/git-utils.shif [ ! -e bots ]; then[ -n "${quiet}" ] || set -xif [ -h ~/.config/cockpit-dev/bots ]; thenmessage SYMLINK "bots → $(realpath --relative-to=. ~/.config/cockpit-dev/bots)"ln -sfT "$(realpath --relative-to=. ~/.config/cockpit-dev)/bots" botselse# it's small, so keep everything cachedfetch_to_cache ${COCKPIT_BOTS_REF+"${COCKPIT_BOTS_REF}"}clone_from_cache "${COCKPIT_BOTS_REF-main}"fielseecho "bots/ already exists, skipping"fi