feat core: Only place legacy placeholders if using alpha or indev as target version

This commit is contained in:
prplwtf 2024-04-06 18:10:01 +02:00
parent b5ff1bb2b5
commit 1bceb1d65b

View file

@ -547,45 +547,48 @@ if [[ ( $2 == "-i" ) || ( $2 == "-install" ) || ( $2 == "-add" ) ]]; then VCMD="
installation_timestamp=$(date +%s) installation_timestamp=$(date +%s)
if [[ $dev == true ]]; then INSTALLMODE="developer"; fi if [[ $dev == true ]]; then INSTALLMODE="developer"; fi
PLACE_PLACEHOLDERS() { if [[ $target == "alpha-"* ]] \
local dir="$1" || [[ $target == "indev-"* ]]; then
for file in "$dir"/*; do PLACE_PLACEHOLDERS() {
if [ -f "$file" ]; then local dir="$1"
file=${file// /\\ } for file in "$dir"/*; do
sed -i \ if [ -f "$file" ]; then
-e "s~\^#version#\^~$version~g" \ file=${file// /\\ }
-e "s~\^#author#\^~$author~g" \
-e "s~\^#name#\^~$name~g" \
-e "s~\^#identifier#\^~$identifier~g" \
-e "s~\^#path#\^~$FOLDER~g" \
-e "s~\^#datapath#\^~$FOLDER/.blueprint/extensions/$identifier/private~g" \
-e "s~\^#publicpath#\^~$FOLDER/.blueprint/extensions/$identifier/public~g" \
-e "s~\^#installmode#\^~$INSTALLMODE~g" \
-e "s~\^#blueprintversion#\^~$VERSION~g" \
-e "s~\^#timestamp#\^~$installation_timestamp~g" \
-e "s~\^#componentroot#\^~@/blueprint/extensions/$identifier~g" \
"$file"
if ! $F_ignoreAlphabetPlaceholders; then
sed -i \ sed -i \
-e "s~__version__~$version~g" \ -e "s~\^#version#\^~$version~g" \
-e "s~__author__~$author~g" \ -e "s~\^#author#\^~$author~g" \
-e "s~__identifier__~$identifier~g" \ -e "s~\^#name#\^~$name~g" \
-e "s~__name__~$name~g" \ -e "s~\^#identifier#\^~$identifier~g" \
-e "s~__path__~$FOLDER~g" \ -e "s~\^#path#\^~$FOLDER~g" \
-e "s~__datapath__~$FOLDER/.blueprint/extensions/$identifier/private~g" \ -e "s~\^#datapath#\^~$FOLDER/.blueprint/extensions/$identifier/private~g" \
-e "s~__publicpath__~$FOLDER/.blueprint/extensions/$identifier/public~g" \ -e "s~\^#publicpath#\^~$FOLDER/.blueprint/extensions/$identifier/public~g" \
-e "s~__installmode__~$INSTALLMODE~g" \ -e "s~\^#installmode#\^~$INSTALLMODE~g" \
-e "s~__blueprintversion__~$VERSION~g" \ -e "s~\^#blueprintversion#\^~$VERSION~g" \
-e "s~__timestamp__~$installation_timestamp~g" \ -e "s~\^#timestamp#\^~$installation_timestamp~g" \
-e "s~__componentroot__~@/blueprint/extensions/$identifier~g" \ -e "s~\^#componentroot#\^~@/blueprint/extensions/$identifier~g" \
"$file" "$file"
if ! $F_ignoreAlphabetPlaceholders; then
sed -i \
-e "s~__version__~$version~g" \
-e "s~__author__~$author~g" \
-e "s~__identifier__~$identifier~g" \
-e "s~__name__~$name~g" \
-e "s~__path__~$FOLDER~g" \
-e "s~__datapath__~$FOLDER/.blueprint/extensions/$identifier/private~g" \
-e "s~__publicpath__~$FOLDER/.blueprint/extensions/$identifier/public~g" \
-e "s~__installmode__~$INSTALLMODE~g" \
-e "s~__blueprintversion__~$VERSION~g" \
-e "s~__timestamp__~$installation_timestamp~g" \
-e "s~__componentroot__~@/blueprint/extensions/$identifier~g" \
"$file"
fi
elif [ -d "$file" ]; then
PLACE_PLACEHOLDERS "$file"
fi fi
elif [ -d "$file" ]; then done
PLACE_PLACEHOLDERS "$file" }
fi PLACE_PLACEHOLDERS "$DIR"
done fi
}
PLACE_PLACEHOLDERS "$DIR"
fi fi
if [[ $name == "" ]]; then rm -R ".blueprint/tmp/$n"; PRINT FATAL "'info_name' is a required configuration option.";exit 1;fi if [[ $name == "" ]]; then rm -R ".blueprint/tmp/$n"; PRINT FATAL "'info_name' is a required configuration option.";exit 1;fi