File: make-bots

package info (click to toggle)
cockpit 354-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 308,956 kB
  • sloc: javascript: 775,606; python: 40,351; ansic: 35,655; cpp: 11,117; sh: 3,511; makefile: 580; xml: 261
file content (30 lines) | stat: -rwxr-xr-x 910 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/sh

# Prepare bots by creating ./bots directory
# Specify $COCKPIT_BOTS_REF to checkout non-main branch

GITHUB_REPO='bots'
SUBDIR='bots'
# Cockpit plugins from different organizations are expected to share the same bots repository
GITHUB_BASE="cockpit-project"

V="${V-0}" # default to friendly messages

set -eu
cd "${0%/*}/../.."
# shellcheck source-path=SCRIPTDIR/../..
. test/common/git-utils.sh

if [ ! -e bots ]; then
    [ -n "${quiet}" ] || set -x
    if [ -h ~/.config/cockpit-dev/bots ]; then
        message SYMLINK "bots → $(realpath --relative-to=. ~/.config/cockpit-dev/bots)"
        ln -sfT "$(realpath --relative-to=. ~/.config/cockpit-dev)/bots" bots
    else
        # it's small, so keep everything cached
        fetch_to_cache ${COCKPIT_BOTS_REF+"${COCKPIT_BOTS_REF}"}
        clone_from_cache "${COCKPIT_BOTS_REF-main}"
    fi
else
    echo "bots/ already exists, skipping"
fi