Delete set -x option

This commit is contained in:
Victor Carlos Erenu
2026-04-14 22:31:15 +07:00
parent ed29a8b11a
commit d8c238a8d1
+11 -16
View File
@@ -30,29 +30,29 @@ grep_command() {
update_version_in_files() { update_version_in_files() {
local OLD_MAYOR="$(echo "${OLD_VERSION}" | cut -d '.' -f 1)" local OLD_MAJOR="$(echo "${OLD_VERSION}" | cut -d '.' -f 1)"
local OLD_MINOR="$(echo "${OLD_VERSION}" | cut -d '.' -f 2)" local OLD_MINOR="$(echo "${OLD_VERSION}" | cut -d '.' -f 2)"
local OLD_PATCH="$(echo "${OLD_VERSION}" | cut -d '.' -f 3)" local OLD_PATCH="$(echo "${OLD_VERSION}" | cut -d '.' -f 3)"
local NEW_MAYOR="$(echo "${VERSION}" | cut -d '.' -f 1)" local NEW_MAJOR="$(echo "${VERSION}" | cut -d '.' -f 1)"
local NEW_MINOR="$(echo "${VERSION}" | cut -d '.' -f 2)" local NEW_MINOR="$(echo "${VERSION}" | cut -d '.' -f 2)"
local NEW_PATCH="$(echo "${VERSION}" | cut -d '.' -f 3)" local NEW_PATCH="$(echo "${VERSION}" | cut -d '.' -f 3)"
m_m_p_files=( $(grep_command "${OLD_MAYOR}\.${OLD_MINOR}\.${OLD_PATCH}" "${DIR}") ) m_m_p_files=( $(grep_command "${OLD_MAJOR}\.${OLD_MINOR}\.${OLD_PATCH}" "${DIR}") )
for file in "${m_m_p_files[@]}"; do for file in "${m_m_p_files[@]}"; do
sed -i "s/\bv${OLD_MAYOR}\.${OLD_MINOR}\.${OLD_PATCH}\b/v${NEW_MAYOR}\.${NEW_MINOR}\.${NEW_PATCH}/g; s/\b${OLD_MAYOR}\.${OLD_MINOR}\.${OLD_PATCH}/${NEW_MAYOR}\.${NEW_MINOR}\.${NEW_PATCH}/g" "${file}" sed -i "s/\bv${OLD_MAJOR}\.${OLD_MINOR}\.${OLD_PATCH}\b/v${NEW_MAJOR}\.${NEW_MINOR}\.${NEW_PATCH}/g; s/\b${OLD_MAJOR}\.${OLD_MINOR}\.${OLD_PATCH}/${NEW_MAJOR}\.${NEW_MINOR}\.${NEW_PATCH}/g" "${file}"
if [[ $(git diff --name-only "${file}") ]]; then if [[ $(git diff --name-only "${file}") ]]; then
FILES_EDITED+=("${file}") FILES_EDITED+=("${file}")
fi fi
done done
m_m_files=( $(grep_command "${OLD_MAYOR}\.${OLD_MINOR}" "${DIR}") ) m_m_files=( $(grep_command "${OLD_MAJOR}\.${OLD_MINOR}" "${DIR}") )
for file in "${m_m_files[@]}"; do for file in "${m_m_files[@]}"; do
sed -i -E "/[0-9]+\.[0-9]+\.[0-9]+/! s/(^|[^0-9.])(${OLD_MAYOR}\.${OLD_MINOR})([^0-9.]|$)/\1${NEW_MAYOR}.${NEW_MINOR}\3/g" "$file" sed -i -E "/[0-9]+\.[0-9]+\.[0-9]+/! s/(^|[^0-9.])(${OLD_MAJOR}\.${OLD_MINOR})([^0-9.]|$)/\1${NEW_MAJOR}.${NEW_MINOR}\3/g" "$file"
if [[ $(git diff --name-only "${file}") ]]; then if [[ $(git diff --name-only "${file}") ]]; then
FILES_EDITED+=("${file}") FILES_EDITED+=("${file}")
fi fi
done done
m_x_files=( $(grep_command "${OLD_MAYOR}\.x" "${DIR}") ) m_x_files=( $(grep_command "${OLD_MAJOR}\.x" "${DIR}") )
for file in "${m_x_files[@]}"; do for file in "${m_x_files[@]}"; do
sed -i "s/\b${OLD_MAYOR}\.x\b/${NEW_MAYOR}\.x/g" "${file}" sed -i "s/\b${OLD_MAJOR}\.x\b/${NEW_MAJOR}\.x/g" "${file}"
if [[ $(git diff --name-only "${file}") ]]; then if [[ $(git diff --name-only "${file}") ]]; then
FILES_EDITED+=("${file}") FILES_EDITED+=("${file}")
fi fi
@@ -97,7 +97,6 @@ update_stage_in_files() {
} }
update_main_in_files() { update_main_in_files() {
set -x
if [[ $STAGE == "alpha0" ]]; then if [[ $STAGE == "alpha0" ]]; then
bump_string="default: '${VERSION}'" bump_string="default: '${VERSION}'"
else else
@@ -113,7 +112,6 @@ update_main_in_files() {
FILES_EDITED+=("${file}") FILES_EDITED+=("${file}")
fi fi
done done
set +x
} }
update_docker_images_tag() { update_docker_images_tag() {
@@ -182,13 +180,10 @@ main() {
fi fi
# Set skip_urls variable based on set_as_main flag # Set skip_urls variable based on set_as_main flag
if [[ -n "$set_as_main" ]]; then if [[ -z "$set_as_main" ]]; then
skip_urls="yes" echo "Updating version from main to $VERSION" | tee -a "${LOG_FILE}"
else update_main_in_files "$VERSION" "$STAGE"
skip_urls="no"
fi fi
echo "Updating version from main to $VERSION" | tee -a "${LOG_FILE}"
update_main_in_files "$VERSION" "$STAGE"
# Validate if tag is true or false # Validate if tag is true or false
if [[ -n "${TAG}" && ! "${TAG}" =~ ^(true|false)$ ]]; then if [[ -n "${TAG}" && ! "${TAG}" =~ ^(true|false)$ ]]; then