43 lines
1.5 KiB
Bash
43 lines
1.5 KiB
Bash
#!/bin/bash
|
|
# This script replaces all references to the development version with the test version
|
|
# 1) Database references and paths
|
|
|
|
git grep -I "connection_data_devel.json" -- '..' ':(exclude)*.sh'
|
|
git grep -I "/var/www/brecal_devel/" -- '..' ':(exclude)*.sh'
|
|
|
|
# 2) Color references
|
|
# Bar colors in client: (BG_COLOR)
|
|
# Devel: #1D751F
|
|
# Test: #751D1F
|
|
# Prod: #203864
|
|
|
|
git grep -I "#1D751F" -- '..' ':(exclude)*.sh'
|
|
|
|
# 3) Assembly name references
|
|
|
|
git grep -I "BreCalDevelClient" -- '..' ':(exclude)*.sh'
|
|
|
|
echo "Proceed? [N/y]"
|
|
read proceed
|
|
|
|
# for color
|
|
|
|
if [ "${proceed}" = "y" ]; then
|
|
|
|
# 1. for database references and paths
|
|
git grep -Il "connection_data_devel.json" -- '..' ':(exclude)*.sh' | xargs sed --in-place -e "s/connection_data_devel.json/connection_data_test.json/g"
|
|
git add $(git grep -Il "connection_data_test.json" -- '..' ':(exclude)*.sh')
|
|
git grep -Il "/var/www/brecal_devel/" -- '..' ':(exclude)*.sh' | xargs sed --in-place -e "s/\/var\/www\/brecal_devel\//\/var\/www\/brecal_test\//g"
|
|
git add $(git grep -Il "/var/www/brecal_test/" -- '..' ':(exclude)*.sh')
|
|
|
|
# 2. for color
|
|
git grep -Il "#1D751F" -- '..' ':(exclude)*.sh' | xargs sed --in-place -e "s/#1D751F/#751D1F/g"
|
|
git add $(git grep -Il "#751D1F" -- '..' ':(exclude)*.sh')
|
|
|
|
# 3. for assembly name
|
|
|
|
git grep -Il "BreCalDevelClient" -- '..' ':(exclude)*.sh' | xargs sed --in-place -e "s/BreCalDevelClient/BreCalTestClient/g"
|
|
git add $(git grep -Il "BreCalTestClient" -- '..' ':(exclude)*.sh')
|
|
|
|
fi
|