File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed
Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -5,24 +5,39 @@ GREEN="\033[0;32m"
55YELLOW=" \033[1;33m"
66NC=" \033[0m" # no color
77
8+ set_or_add_remote () {
9+ local REMOTE_NAME=$1
10+ local REMOTE_URL=$2
11+ local REPO_PATH=" /workspaces/$REPO_NAME "
12+
13+ git -C " $REPO_PATH " remote get-url " $REMOTE_NAME " & > /dev/null || git -C " $REPO_PATH " remote add " $REMOTE_NAME " " $REMOTE_URL "
14+ git -C " $REPO_PATH " remote set-url " $REMOTE_NAME " " $REMOTE_URL "
15+ }
16+
817setup_repo () {
918 local DIR_NAME=" $1 "
1019 local DIR_PATH=" /workspaces/$DIR_NAME "
1120 local REPO=" Azure/$DIR_NAME "
1221
1322 if [ -d " $DIR_PATH " ]; then
1423 echo -e " \n${YELLOW} ($DIR_NAME ) Pulling the latest changes from upstream...${NC} "
24+ gh repo fork " $REPO " --clone=false
1525 else
1626 echo -e " \n${GREEN} ($DIR_NAME ) Forking and cloning the repository...${NC} "
1727 gh repo fork " $REPO " --clone=true
1828 fi
1929
20- HEAD_BRANCH=$( git -C " $DIR_PATH " remote show upstream | grep " HEAD branch" | awk ' {print $NF}' )
21- git -C " $DIR_PATH " pull -r upstream " $HEAD_BRANCH "
30+ cd " $DIR_PATH "
31+ gh repo sync --source " $REPO "
32+ cd /workspaces
2233}
2334
2435SECONDS=0
2536
37+ REPO_NAME=$( basename " $GITHUB_REPOSITORY " )
38+ set_or_add_remote origin " https://github.com/$GITHUB_USER /$REPO_NAME .git"
39+ set_or_add_remote upstream " https://github.com/Azure/$REPO_NAME .git"
40+
2641pip install aaz-dev
2742
2843# azdev repositories
You can’t perform that action at this time.
0 commit comments