"Fossies" - the Fresh Open Source Software Archive

Member "jitsi-meet-7309/resources/update-ljm.sh" (31 May 2023, 1420 Bytes) of package /linux/misc/jitsi-meet-7309.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 #!/bin/bash
    2 
    3 set -e -u
    4 
    5 if [[ ! -z $(git status -s --untracked-files=no) ]]; then
    6     echo "Git tree is not clean, aborting!"
    7     exit 1
    8 fi
    9 
   10 BRANCH=$(git rev-parse --abbrev-ref HEAD)
   11 if [[ "$BRANCH" != "master" ]]; then
   12   echo "Not on master, aborting!";
   13   exit 1;
   14 fi
   15 
   16 THIS_DIR=$(cd -P "$(dirname "$(readlink "${BASH_SOURCE[0]}" || echo "${BASH_SOURCE[0]}")")" && pwd)
   17 
   18 pushd ${THIS_DIR}/..
   19 CURRENT_LJM_DEP=$(jq -r '.dependencies."lib-jitsi-meet"' package.json)
   20 popd
   21 
   22 NEW_LJM_RELEASE=$(gh release list --limit 1 --repo jitsi/lib-jitsi-meet | awk {'print $1'})
   23 GH_LINK="https://github.com/jitsi/lib-jitsi-meet/releases/tag/${NEW_LJM_RELEASE}"
   24 LATEST_LJM_DEP="https://github.com/jitsi/lib-jitsi-meet/releases/download/${NEW_LJM_RELEASE}/lib-jitsi-meet.tgz"
   25 
   26 if [[ "${CURRENT_LJM_DEP}" == "${LATEST_LJM_DEP}" ]]; then
   27     echo "No need to update, already on the latest commit!"
   28     exit 1
   29 fi
   30 
   31 if [[ ${CURRENT_LJM_DEP} =~ ^.*download/(.*)/lib-jitsi-meet\.tgz$ ]]; then
   32   COMMIT_MSG="https://github.com/jitsi/lib-jitsi-meet/compare/${BASH_REMATCH[1]}...${NEW_LJM_RELEASE}"
   33 else
   34   COMMIT_MSG=${GH_LINK}
   35 fi
   36 
   37 pushd ${THIS_DIR}/..
   38 EPOCH=$(date +%s)
   39 NEW_BRANCH="update-ljm-${EPOCH}"
   40 git checkout -b ${NEW_BRANCH}
   41 npm install ${LATEST_LJM_DEP}
   42 git add package.json package-lock.json
   43 git commit -m "chore(deps) lib-jitsi-meet@latest" -m "${COMMIT_MSG}"
   44 git push origin ${NEW_BRANCH}
   45 gh pr create --repo jitsi/jitsi-meet --fill
   46 popd