File: fetch-scripts.sh

package info (click to toggle)
golang-github-pion-sdp 3.0.17-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 376 kB
  • sloc: makefile: 2
file content (31 lines) | stat: -rwxr-xr-x 896 bytes parent folder | download | duplicates (10)
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
31
#!/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.
#
# SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly>
# SPDX-License-Identifier: MIT

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