This is an automated email from the ASF dual-hosted git repository.

jleroux pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git


The following commit(s) were added to refs/heads/trunk by this push:
     new cd2a63b069 Fixed: pullAllPluginsSource.sh deleted local .git directory 
(OFBIZ-12927)
cd2a63b069 is described below

commit cd2a63b069945cee80d3b37018667f630e57a7cf
Author: Jacques Le Roux <jacques.le.r...@les7arts.com>
AuthorDate: Sat Mar 16 07:54:36 2024 +0100

    Fixed: pullAllPluginsSource.sh deleted local .git directory (OFBIZ-12927)
    
    The script ran into an issue cloning the ofbiz-plugins repository to a local
    plugins directory. This mean that the plugins directory was not created,
    
    Daniel Watford's recommendation:
    1. Replace
        cd plugins
        rm -rf .git
        cd ..
     with:
        rm -r plugins/.git
    2. Add `set -e` early in the script to configure exit if an error occurs on 
any
    command.
    
    jleroux: while at it I did the same for pullAllPluginsSource.bat
    
    Thanks: Daniel
---
 pullAllPluginsSource.bat | 14 ++++++--------
 pullAllPluginsSource.sh  |  6 +++---
 2 files changed, 9 insertions(+), 11 deletions(-)

diff --git a/pullAllPluginsSource.bat b/pullAllPluginsSource.bat
index d10f5757b8..5c8b1889bf 100644
--- a/pullAllPluginsSource.bat
+++ b/pullAllPluginsSource.bat
@@ -22,17 +22,15 @@ rem Syntax: pullAllPluginsSource
 
 rem Whatever, create anew
 if EXIST plugins\ (
-    cmd /c rd  /s/q plugins
+    cmd /c rd /s/q plugins || exit /b
 )
 
 rem Get the branch used in framework
-git branch --show-current > temp.txt
-set /p branch=<temp.txt
-del temp.txt
+git branch --show-current > temp.txt || exit /b
+set /p branch=<temp.txt || exit /b
+del temp.txt || exit /b
 
-git clone --depth 1 --single-branch --branch %branch% 
https://github.com/apache/ofbiz-plugins.git plugins
+git clone --depth 1 --single-branch --branch %branch% 
https://github.com/apache/ofbiz-plugins.git plugins || exit /b
 
 rem Remove .git, in this case it's useless information
-cd plugins
-cmd /c rd /s/q .git
-cd ..
+rd /s/q plugins\.git
diff --git a/pullAllPluginsSource.sh b/pullAllPluginsSource.sh
index c53d60db39..9d0f89b591 100755
--- a/pullAllPluginsSource.sh
+++ b/pullAllPluginsSource.sh
@@ -18,6 +18,8 @@
 
 # Syntax: ./pullAllPluginsSource.sh
 
+set -e
+
 # Whatever, create anew
 if [ -d "plugins" ]
     then
@@ -30,6 +32,4 @@ branch=$(git branch --show-current)
 git clone --depth 1 --single-branch --branch $branch 
https://github.com/apache/ofbiz-plugins.git plugins
 
 # remove .git, in this case it's useless information
-cd plugins
-rm -rf .git
-cd ..
+rm -r plugins/.git
\ No newline at end of file

Reply via email to