From 39c7aecbae6b7908418dbb05957d352fd1bda7fd Mon Sep 17 00:00:00 2001 From: Mauro Rosero P Date: Wed, 4 Dec 2024 05:15:23 -0500 Subject: [PATCH] =?UTF-8?q?[FIXED]=20Se=20corrige=20los=20problemas=20la?= =?UTF-8?q?=20rama=20de=20proyectos=20nuevos=20-=20Se=20crea=20una=20rama?= =?UTF-8?q?=20devs=20de=20trabajo=20o=20desarrollo=20-=20Se=20crea=20una?= =?UTF-8?q?=20rama=20v=20donde=20=20representa=20la=20versi=C3=B3n?= =?UTF-8?q?=20de=20odoo=20para=20producci=C3=B3n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bin/lib/base.lib | 14 +++++--------- bin/project.sh | 15 ++++++++------- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/bin/lib/base.lib b/bin/lib/base.lib index edeac31..aa0f104 100644 --- a/bin/lib/base.lib +++ b/bin/lib/base.lib @@ -143,13 +143,8 @@ function git_init() { local REPO_PATH=$1 local BRANCH=$2 - cd $REPO_PATH - if [ $? -eq 0 ]; then - git init -b $BRANCH - return $? - else - return 255 - fi + git init "$REPO_PATH" -b $BRANCH + return $? } @@ -169,13 +164,14 @@ function git_add_full() { } # Git add tracked files to repository -function git_commit_first() { +function git_commit() { local REPO_PATH=$1 + local GIT_MESSAGES=$2 cd $REPO_PATH if [ $? -eq 0 ]; then - git commit -m "$git_first_commited" + git commit -m "$GIT_MESSAGES" return $? else return 255 diff --git a/bin/project.sh b/bin/project.sh index 62a5fe6..ac2fa07 100755 --- a/bin/project.sh +++ b/bin/project.sh @@ -113,7 +113,7 @@ fi # Check if odoo version is supported odoo_verscheck $ODOO_VERS -if [ $? -eq 0 ]; then +if [ $? -ne 0 ]; then echo "[-] $odmsg_014_1 $ODOO_VERS $odmsg_014_2" exit 2 fi @@ -140,28 +140,29 @@ copy_odooapps $BIN_HOME "$PROJECT_NAME" "${ODOO_VERS}" $ODOO_PKG_DEVS copy_odooapps $BIN_HOME "$PROJECT_NAME" "${ODOO_VERS}" $ODOO_PKG_INAR # Initialize git repository -if [ ! -d "$BIN_HOME/$PROJECT_NAME/$ODOO_APP/.git" ] +if [ ! -d "$BIN_HOME/$PROJECT_NAME/.git" ] then - result=$(git_init "$BIN_HOME/$PROJECT_NAME/$ODOO_APP" $ODOO_DEF_BRCH) + result=$(git_init "$BIN_HOME/$PROJECT_NAME" "v$ODOO_VERS") if [ $? -eq 0 ]; then echo "[x] $result" - echo "[x] $git_setbranch: $ODOO_DEF_BRCH" - cp -f $BIN_HOME/$ODOO_CFG/$ODOO_CFG_GITI $BIN_HOME/$PROJECT_NAME/$ODOO_APP/ + echo "[x] $git_setbranch: v$ODOO_VERS" + cp -f $BIN_HOME/$ODOO_CFG/$ODOO_CFG_GITI $BIN_HOME/$PROJECT_NAME/ echo "[x] $git_gitignored $ODOO_CFG_GITI" else echo echo "[-] $git_notinitialized" fi - result=$(git_add_full "$BIN_HOME/$PROJECT_NAME/$ODOO_APP") + result=$(git_add_full "$BIN_HOME/$PROJECT_NAME") if [ $? -eq 0 ]; then echo "[x] $git_add_files" else echo "$result" fi - result=$(git_commit_first "$BIN_HOME/$PROJECT_NAME/$ODOO_APP") + result=$(git_commit "$BIN_HOME/$PROJECT_NAME" "$git_first_commited") if [ $? -eq 0 ]; then echo "[x] $git_end_commited" + cd $BIN_HOME/$PROJECT_NAME && git checkout -q -b $ODOO_DEF_BRCH && echo "[x] $git_setbranch: $ODOO_DEF_BRCH" else echo "$result" fi