Show current version for a brief moment on /extensions/blueprint

This commit is contained in:
purple 2023-06-01 22:00:02 +02:00
parent bf37806570
commit 01188912c6
2 changed files with 6 additions and 3 deletions

View file

@ -18,12 +18,14 @@ fi;
if [[ -d "/var/www/$FOLDER/blueprint" ]]; then mv /var/www/$FOLDER/blueprint /var/www/$FOLDER/.blueprint; fi; if [[ -d "/var/www/$FOLDER/blueprint" ]]; then mv /var/www/$FOLDER/blueprint /var/www/$FOLDER/.blueprint; fi;
# BUILT_FROM_SOURCE="y"; # If you downloaded Blueprint from a release instead of building it, this should be "n". # BUILT_FROM_SOURCE="y"; # If you downloaded Blueprint from a release instead of building it, this should be "n".
if [[ $BUILT_FROM_SOURCE == "y" ]]; then if [[ ! -f "/var/www/$FOLDER/.blueprint/.storage/versionschemefix.flag" ]]; then sed -E -i "s*&bp.version&*source*g" app/Services/Helpers/BlueprintPlaceholderService.php;touch /var/www/$FOLDER/.blueprint/.storage/versionschemefix.flag;fi;VERSION="source"; # if [[ $BUILT_FROM_SOURCE == "y" ]]; then if [[ ! -f "/var/www/$FOLDER/.blueprint/.storage/versionschemefix.flag" ]]; then sed -E -i "s*&bp.version&*source*g" app/Services/Helpers/BlueprintPlaceholderService.php;touch /var/www/$FOLDER/.blueprint/.storage/versionschemefix.flag;fi;VERSION="source";
elif [[ $PM_VERSION == "([(pterodactylmarket""_version)])" ]]; then elif [[ $PM_VERSION == "([(pterodactylmarket""_version)])" ]]; then
# This runs when the placeholder has not changed, indicating an issue with PterodactylMarket # This runs when the placeholder has not changed, indicating an issue with PterodactylMarket
# or Blueprint being installed from other sources. # or Blueprint being installed from other sources.
if [[ ! -f "/var/www/$FOLDER/.blueprint/.storage/versionschemefix.flag" ]]; then if [[ ! -f "/var/www/$FOLDER/.blueprint/.storage/versionschemefix.flag" ]]; then
sed -E -i "s*&bp.version&*$VER_FALLBACK*g" app/Services/Helpers/BlueprintPlaceholderService.php; sed -E -i "s*&bp.version&*$VER_FALLBACK*g" app/Services/Helpers/BlueprintPlaceholderService.php;
sed -E -i "s*@version*$VER_FALLBACK*g" public/extensions/blueprint/index.html;
touch /var/www/$FOLDER/.blueprint/.storage/versionschemefix.flag; touch /var/www/$FOLDER/.blueprint/.storage/versionschemefix.flag;
fi; fi;
@ -33,6 +35,7 @@ elif [[ $PM_VERSION != "([(pterodactylmarket""_version)])" ]]; then
# fallback version. # fallback version.
if [[ ! -f "/var/www/$FOLDER/.blueprint/.storage/versionschemefix.flag" ]]; then if [[ ! -f "/var/www/$FOLDER/.blueprint/.storage/versionschemefix.flag" ]]; then
sed -E -i "s*&bp.version&*$PM_VERSION*g" app/Services/Helpers/BlueprintPlaceholderService.php; sed -E -i "s*&bp.version&*$PM_VERSION*g" app/Services/Helpers/BlueprintPlaceholderService.php;
sed -E -i "s*@version*$PM_VERSION*g" public/extensions/blueprint/index.html;
touch /var/www/$FOLDER/.blueprint/.storage/versionschemefix.flag; touch /var/www/$FOLDER/.blueprint/.storage/versionschemefix.flag;
fi; fi;

View file

@ -2,5 +2,5 @@
<meta http-equiv="refresh" content="0; url=https://ptero.shop/" /> <meta http-equiv="refresh" content="0; url=https://ptero.shop/" />
</head> </head>
<body> <body>
<p></p> <p>@version</p>
</body> </body>