#!/bin/bash ########################################################################### # # Copyright (c) 2023-2024 Diality Inc. - All Rights Reserved. # # THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN # WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. # # @file cho.sh # # @author (last) Behrouz NematiPour # @date (last) 26-Jul-2023 # @author (original) Behrouz NematiPour # @date (original) 26-Jul-2023 # ############################################################################ branch="$1" if [ "$1" = "" ]; then echo "branch is empty" exit 1 else echo "branch is $1" fi function checkout() { local repository="$1" out=$(git -C "$repository" checkout -b "$branch" 2>&1 || git -C "$repository" checkout "$branch" 2>&1 ) if [ ! -z $? ]; then echo " *** $repository checkout failed *** " echo "$out" echo "" else out=$(git -C "$repository" pull 2>&1) if [ ! -z $? ]; then echo " *** $repository pull failed *** " echo "$out" echo "" fi fi } checkout "../ui.scripts" checkout "../ui.config" checkout "../common"