merge #40: itsvic-dev/vic/no-folder-placeholders

chore: don't use `::f` placeholders
This commit is contained in:
Ivy 2024-06-13 10:26:19 +02:00 committed by GitHub
commit ed9ecf5744
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 5 additions and 9 deletions

View file

@ -145,7 +145,7 @@ class BlueprintAdminLibrary
* [BlueprintExtensionLibrary documentation](https://blueprint.zip/docs/?page=documentation/$blueprint) * [BlueprintExtensionLibrary documentation](https://blueprint.zip/docs/?page=documentation/$blueprint)
*/ */
public function extension($identifier): bool { public function extension($identifier): bool {
if(str_contains($this->fileRead("::f/.blueprint/extensions/blueprint/private/db/installed_extensions"), $identifier.',')) { if(str_contains($this->fileRead(base_path(".blueprint/extensions/blueprint/private/db/installed_extensions")), $identifier.',')) {
return true; return true;
} else { } else {
return false; return false;

View file

@ -102,7 +102,7 @@ class BlueprintClientLibrary
* [BlueprintExtensionLibrary documentation](https://blueprint.zip/docs/?page=documentation/$blueprint) * [BlueprintExtensionLibrary documentation](https://blueprint.zip/docs/?page=documentation/$blueprint)
*/ */
public function extension($identifier): bool { public function extension($identifier): bool {
if(str_contains($this->fileRead("::f/.blueprint/extensions/blueprint/private/db/installed_extensions"), $identifier.',')) { if(str_contains($this->fileRead(base_path(".blueprint/extensions/blueprint/private/db/installed_extensions")), $identifier.',')) {
return true; return true;
} else { } else {
return false; return false;

View file

@ -5,7 +5,7 @@ namespace Pterodactyl\BlueprintFramework\Services\PlaceholderService;
class BlueprintPlaceholderService class BlueprintPlaceholderService
{ {
public function version(): string { return "::v"; } public function version(): string { return "::v"; }
public function folder(): string { return "::f"; } public function folder(): string { return base_path(); }
public function installed(): string { return "NOTINSTALLED"; } public function installed(): string { return "NOTINSTALLED"; }
public function api_url(): string { return "http://api.blueprint.zip:50000"; } public function api_url(): string { return "http://api.blueprint.zip:50000"; }
} }

View file

@ -6,7 +6,8 @@
# This should allow Blueprint to run in Docker. Please note that changing the $FOLDER variable after running # This should allow Blueprint to run in Docker. Please note that changing the $FOLDER variable after running
# the Blueprint installation script will not change anything in any files besides blueprint.sh. # the Blueprint installation script will not change anything in any files besides blueprint.sh.
FOLDER="/var/www/pterodactyl" #; FOLDER="$(realpath $(dirname $0))" #;
# Technically shouldn't be needed now, but I'm not going to touch this for now just in case it breaks stuff on Docker. -- @itsvic-dev
DOCKERFOLDER="/app" DOCKERFOLDER="/app"
# This stores the webserver ownership user which Blueprint uses when applying webserver permissions. # This stores the webserver ownership user which Blueprint uses when applying webserver permissions.
@ -222,11 +223,6 @@ if [[ $1 != "-bash" ]]; then
php artisan storage:link &>> $BLUEPRINT__DEBUG php artisan storage:link &>> $BLUEPRINT__DEBUG
PRINT INFO "Replacing internal placeholders.." PRINT INFO "Replacing internal placeholders.."
# Update folder placeholder on PlaceholderService and admin layout.
# Should avoid doing stuff this way in the future!
sed -i "s~::f~$FOLDER~g" $FOLDER/app/BlueprintFramework/Services/PlaceholderService/BlueprintPlaceholderService.php
sed -i "s~::f~$FOLDER~g" $FOLDER/app/BlueprintFramework/Libraries/ExtensionLibrary/Admin/BlueprintAdminLibrary.php
sed -i "s~::f~$FOLDER~g" $FOLDER/app/BlueprintFramework/Libraries/ExtensionLibrary/Client/BlueprintClientLibrary.php
# Copy "Blueprint" extension page logo from assets. # Copy "Blueprint" extension page logo from assets.
cp $FOLDER/.blueprint/assets/logo.jpg $FOLDER/.blueprint/extensions/blueprint/assets/logo.jpg cp $FOLDER/.blueprint/assets/logo.jpg $FOLDER/.blueprint/extensions/blueprint/assets/logo.jpg