github.com/pion/webrtc/v3@v3.2.24/.github/fetch-scripts.sh (about)

     1  #!/bin/sh
     2  
     3  #
     4  # DO NOT EDIT THIS FILE
     5  #
     6  # It is automatically copied from https://github.com/pion/.goassets repository.
     7  #
     8  # If you want to update the shared CI config, send a PR to
     9  # https://github.com/pion/.goassets instead of this repository.
    10  #
    11  # SPDX-FileCopyrightText: 2023 The Pion community <https://pion.ly>
    12  # SPDX-License-Identifier: MIT
    13  
    14  set -eu
    15  
    16  SCRIPT_PATH="$(realpath "$(dirname "$0")")"
    17  GOASSETS_PATH="${SCRIPT_PATH}/.goassets"
    18  
    19  GOASSETS_REF=${GOASSETS_REF:-master}
    20  
    21  if [ -d "${GOASSETS_PATH}" ]; then
    22    if ! git -C "${GOASSETS_PATH}" diff --exit-code; then
    23      echo "${GOASSETS_PATH} has uncommitted changes" >&2
    24      exit 1
    25    fi
    26    git -C "${GOASSETS_PATH}" fetch origin
    27    git -C "${GOASSETS_PATH}" checkout ${GOASSETS_REF}
    28    git -C "${GOASSETS_PATH}" reset --hard origin/${GOASSETS_REF}
    29  else
    30    git clone -b ${GOASSETS_REF} https://github.com/pion/.goassets.git "${GOASSETS_PATH}"
    31  fi