Skip to content
Snippets Groups Projects

Handle non sharable values

Merged Hahn Axel (hahn) requested to merge handle-non-sharable-values into master
4 files
+ 37
11
Compare changes
  • Side-by-side
  • Inline
Files
4
+ 12
8
@@ -31,11 +31,12 @@
# 2024-11-20 v1.24 <axel.hahn@unibe.ch> fix menu with started database less app; apply template permissions on target file; add $WEBURL; remove $frontendurl
# 2024-11-20 v1.25 <axel.hahn@unibe.ch> fix menu startup containers
# 2024-11-21 v1.26 <axel.hahn@unibe.ch> Reset colors in _checkConfig
# 2025-05-13 v1.27 <axel.hahn@unibe.ch> handle addition variables config file for non sharable values
# ======================================================================
cd "$( dirname "$0" )" || exit 1
_version="1.26"
_version="1.27"
# init used vars
gittarget=
@@ -45,7 +46,7 @@ _self=$( basename "$0" )
# shellcheck source=/dev/null
. "${_self}.cfg" || exit 1
. "${_self}_not_shared.cfg" 2>/dev/null
# git@git-repo.iml.unibe.ch:iml-open-source/docker-php-starterkit.git
selfgitrepo="docker-php-starterkit.git"
@@ -406,15 +407,18 @@ function _fix_no-db(){
# used in _generateFiles
function _getreplaces(){
# loop over vars to make the replacement
grep "^[a-zA-Z]" "$_self.cfg" | while read -r line
for myfile in "${_self}.cfg" "${_self}_not_shared.cfg"
do
# echo replacement: $line
mykey=$( echo "$line" | cut -f 1 -d '=' )
myvalue="$( eval echo \"\$"$mykey"\" )"
grep "^[a-zA-Z]" "${myfile}" | while read -r line
do
# echo replacement: $line
mykey=$( echo "$line" | cut -f 1 -d '=' )
myvalue="$( eval echo \"\$"$mykey"\" )"
# TODO: multiline values fail here in replacement with sed
echo -e "s#{{$mykey}}#${myvalue}#g"
# TODO: multiline values fail here in replacement with sed
echo -e "s#{{$mykey}}#${myvalue}#g"
done
done
}
Loading