git_brcal/misc/copytest.sh

43 lines
1.2 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"
git grep -I "/var/www/brecal_devel/"
# 2) Color references
# Bar colors in client: (BG_COLOR)
# Devel: #1D751F
# Test: #751D1F
# Prod: #203864
git grep -I "#1D751F"
# 3) Assembly name references
git grep -I "BreCalDevelClient"
echo "Proceed? [N/y]"
read proceed
# for color
if [ "${proceed}" = "y" ]; then
# 1. for database references and paths
git grep -I "connection_data_devel.json" | xargs sed --in-place -e "s/connection_data_devel.json/connection_data_test.json/g"
git add $(git grep -I "connection_data_test.json")
git grep -I "/var/www/brecal_devel/" | xargs sed --in-place -e "s/\/var\/www\/brecal_devel\//\/var\/www\/brecal_test\//g"
git add $(git grep -I "/var/www/brecal_test/")
# 2. for color
git grep -Il "#1D751F" | xargs sed --in-place -e "s/#1D751F/#751D1F/g"
git add $(git grep -Il "#751D1F")
# 3. for assembly name
git grep -I "BreCalDevelClient" | xargs sed --in-place -e "s/BreCalDevelClient/BreCalTestClient/g"
git add $(git grep -I "BreCalTestClient")
fi