File: make-bots

package info (click to toggle)
cockpit 239-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 67,268 kB
  • sloc: javascript: 245,474; ansic: 72,273; python: 23,634; xml: 6,155; sh: 2,919; makefile: 923; sed: 5
file content (17 lines) | stat: -rwxr-xr-x 561 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/bin/sh

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

set -e

if [ ! -d bots ]; then
    git clone --quiet --reference-if-able ${XDG_CACHE_HOME:-$HOME/.cache}/cockpit-project/bots https://github.com/cockpit-project/bots.git
    if [ -n "$COCKPIT_BOTS_REF" ]; then
        git -C bots fetch --quiet --depth=1 origin $COCKPIT_BOTS_REF
        git -C bots checkout --quiet FETCH_HEAD
    fi
    echo "checked out bots/ ref $(git -C bots rev-parse HEAD)"
else
    echo "bots/ already exists, skipping"
fi