File: fetch-scripts.sh

package info (click to toggle)
golang-github-pion-mdns 0.0.7-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bookworm-backports, forky, sid, trixie
  • size: 188 kB
  • sloc: makefile: 5
file content (29 lines) | stat: -rwxr-xr-x 797 bytes parent folder | download | duplicates (11)
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
#!/bin/sh

#
# DO NOT EDIT THIS FILE
#
# It is automatically copied from https://github.com/pion/.goassets repository.
#
# If you want to update the shared CI config, send a PR to
# https://github.com/pion/.goassets instead of this repository.
#

set -eu

SCRIPT_PATH="$(realpath "$(dirname "$0")")"
GOASSETS_PATH="${SCRIPT_PATH}/.goassets"

GOASSETS_REF=${GOASSETS_REF:-master}

if [ -d "${GOASSETS_PATH}" ]; then
  if ! git -C "${GOASSETS_PATH}" diff --exit-code; then
    echo "${GOASSETS_PATH} has uncommitted changes" >&2
    exit 1
  fi
  git -C "${GOASSETS_PATH}" fetch origin
  git -C "${GOASSETS_PATH}" checkout ${GOASSETS_REF}
  git -C "${GOASSETS_PATH}" reset --hard origin/${GOASSETS_REF}
else
  git clone -b ${GOASSETS_REF} https://github.com/pion/.goassets.git "${GOASSETS_PATH}"
fi