Skip to content

Commit

Permalink
Fixed: Replace SvnCheckout in Gradle (OFBIZ-12868)
Browse files Browse the repository at this point in the history
Fixes issues while switching branches
  • Loading branch information
JacquesLeRoux committed Jan 2, 2024
1 parent 1eb5a52 commit e16c0b3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
5 changes: 3 additions & 2 deletions pullAllPluginsSource.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ if [ -d "plugins" ]
rm -rf plugins
fi

# Get the branch used by the framework
git branch --show-current > temp.txt
branch=$(cat temp.txt)
rm temp.txt
Expand All @@ -30,9 +31,9 @@ git clone https://github.com/apache/ofbiz-plugins.git plugins
cd plugins

# By default the clone branch is trunk
if [ ! trunk == "$branch" ]
if [ ! $branch = trunk ]
then
git switch -c "$branch" --track origin/"$branch"
git switch "$branch"
fi

# remove .git, in this case it's big useless information
Expand Down
7 changes: 5 additions & 2 deletions pullPluginSource.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,16 @@ fi

# Add the plugin
git sparse-checkout add "$1"

# Get the branch used in framework
cd ..
git branch --show-current > temp.txt
branch=$(cat temp.txt)
rm temp.txt

# By default the clone branch is trunk
if [ ! trunk == "$branch" ]
if [ ! "$branch" = trunk ]
then
call git switch -c "$1" --track origin/"$1"
git switch "$branch"
fi
cd ..

0 comments on commit e16c0b3

Please sign in to comment.