@@ -49,6 +49,8 @@ export BLUEPRINT__FOLDER=$FOLDER
49
49
export BLUEPRINT__VERSION=$VERSION
50
50
export BLUEPRINT__DEBUG=" $FOLDER " /.blueprint/extensions/blueprint/private/debug/logs.txt
51
51
export NODE_OPTIONS=--openssl-legacy-provider
52
+ # Write internal variables.
53
+ __BuildDir=" .blueprint/extensions/blueprint/private/build"
52
54
53
55
# Automatically navigate to the Pterodactyl directory when running the core.
54
56
cd $FOLDER || return
@@ -217,8 +219,8 @@ if [[ $1 != "-bash" ]]; then
217
219
# Flush cache.
218
220
PRINT INFO " Flushing view, config and route cache.."
219
221
{
220
- php artisan view:clear
221
- php artisan config:clear
222
+ php artisan view:cache
223
+ php artisan config:cache
222
224
php artisan route:cache
223
225
php artisan cache:clear
224
226
} & >> $BLUEPRINT__DEBUG
@@ -787,14 +789,14 @@ if [[ ( $2 == "-i" ) || ( $2 == "-install" ) || ( $2 == "-add" ) ]]; then VCMD="
787
789
if [[ $Components_Navigation_Routes_ != " " ]]; then
788
790
PRINT INFO " Linking navigation routes.."
789
791
790
- ImportConstructor=" .blueprint/extensions/blueprint/private/build /extensions/routes/importConstructor.bak"
791
- AccountRouteConstructor=" .blueprint/extensions/blueprint/private/build /extensions/routes/accountRouteConstructor.bak"
792
- ServerRouteConstructor=" .blueprint/extensions/blueprint/private/build /extensions/routes/serverRouteConstructor.bak"
792
+ ImportConstructor=" $__BuildDir /extensions/routes/importConstructor.bak"
793
+ AccountRouteConstructor=" $__BuildDir /extensions/routes/accountRouteConstructor.bak"
794
+ ServerRouteConstructor=" $__BuildDir /extensions/routes/serverRouteConstructor.bak"
793
795
794
796
{
795
- cp " .blueprint/extensions/blueprint/private/build /extensions/routes/importConstructor" " $ImportConstructor "
796
- cp " .blueprint/extensions/blueprint/private/build /extensions/routes/accountRouteConstructor" " $AccountRouteConstructor "
797
- cp " .blueprint/extensions/blueprint/private/build /extensions/routes/serverRouteConstructor" " $ServerRouteConstructor "
797
+ cp " $__BuildDir /extensions/routes/importConstructor" " $ImportConstructor "
798
+ cp " $__BuildDir /extensions/routes/accountRouteConstructor" " $AccountRouteConstructor "
799
+ cp " $__BuildDir /extensions/routes/serverRouteConstructor" " $ServerRouteConstructor "
798
800
} 2>> $BLUEPRINT__DEBUG
799
801
800
802
sed -i " s~\[id\^]~" " ${identifier^} " " ~g" $ImportConstructor
@@ -959,16 +961,18 @@ if [[ ( $2 == "-i" ) || ( $2 == "-install" ) || ( $2 == "-add" ) ]]; then VCMD="
959
961
fi
960
962
961
963
# Prepare build files.
962
- AdminControllerConstructor=" .blueprint/extensions/blueprint/private/build/extensions/controller.build.bak"
963
- AdminBladeConstructor=" .blueprint/extensions/blueprint/private/build/extensions/admin.blade.php.bak"
964
- AdminRouteConstructor=" .blueprint/extensions/blueprint/private/build/extensions/route.php.bak"
965
- AdminButtonConstructor=" .blueprint/extensions/blueprint/private/build/extensions/button.blade.php.bak"
964
+ AdminControllerConstructor=" $__BuildDir /extensions/controller.build.bak"
965
+ AdminBladeConstructor=" $__BuildDir /extensions/admin.blade.php.bak"
966
+ AdminRouteConstructor=" $__BuildDir /extensions/route.php.bak"
967
+ AdminButtonConstructor=" $__BuildDir /extensions/button.blade.php.bak"
968
+ ConfigExtensionFS=" $__BuildDir /extensions/config/ExtensionFS.build.bak"
966
969
967
970
{
968
- if [[ $controller_type == " default" ]]; then cp " .blueprint/extensions/blueprint/private/build/extensions/controller.build" " $AdminControllerConstructor " ; fi
969
- cp " .blueprint/extensions/blueprint/private/build/extensions/admin.blade.php" " $AdminBladeConstructor "
970
- cp " .blueprint/extensions/blueprint/private/build/extensions/route.php" " $AdminRouteConstructor "
971
- cp " .blueprint/extensions/blueprint/private/build/extensions/button.blade.php" " $AdminButtonConstructor "
971
+ if [[ $controller_type == " default" ]]; then cp " $__BuildDir /extensions/controller.build" " $AdminControllerConstructor " ; fi
972
+ cp " $__BuildDir /extensions/admin.blade.php" " $AdminBladeConstructor "
973
+ cp " $__BuildDir /extensions/route.php" " $AdminRouteConstructor "
974
+ cp " $__BuildDir /extensions/button.blade.php" " $AdminButtonConstructor "
975
+ cp " $__BuildDir /extensions/config/ExtensionFS.build" " $ConfigExtensionFS "
972
976
} 2>> $BLUEPRINT__DEBUG ;
973
977
974
978
@@ -1067,14 +1071,18 @@ if [[ ( $2 == "-i" ) || ( $2 == "-install" ) || ( $2 == "-add" ) ]]; then VCMD="
1067
1071
# Construct admin controller
1068
1072
if [[ $controller_type == " default" ]]; then sed -i " s~\[id\]~$identifier ~g" " $AdminControllerConstructor " ; fi
1069
1073
1074
+ # Construct ExtensionFS
1075
+ sed -i \
1076
+ -e " s~\[id\]~$identifier ~g" \
1077
+ -e " s~\[id\^\]~${identifier^} ~g" \
1078
+ " $ConfigExtensionFS "
1070
1079
1071
1080
# Read final results.
1072
1081
ADMINVIEW_RESULT=$( < " $AdminBladeConstructor " )
1073
1082
ADMINROUTE_RESULT=$( < " $AdminRouteConstructor " )
1074
1083
ADMINBUTTON_RESULT=$( < " $AdminButtonConstructor " )
1075
- if [[ $controller_type == " default" ]]; then
1076
- ADMINCONTROLLER_RESULT=$( < " $AdminControllerConstructor " )
1077
- fi
1084
+ if [[ $controller_type == " default" ]]; then ADMINCONTROLLER_RESULT=$( < " $AdminControllerConstructor " ) ; fi
1085
+ CONFIGEXTENSIONFS_RESULT=$( < " $ConfigExtensionFS " )
1078
1086
ADMINCONTROLLER_NAME=" ${identifier} ExtensionController.php"
1079
1087
1080
1088
# Place admin extension view.
@@ -1146,18 +1154,36 @@ if [[ ( $2 == "-i" ) || ( $2 == "-install" ) || ( $2 == "-add" ) ]]; then VCMD="
1146
1154
sed -i " /<\!-- wrapper:insert -->/r .blueprint/tmp/$n /$admin_wrapper " " resources/views/blueprint/admin/admin.blade.php"
1147
1155
fi
1148
1156
1157
+ # Create extension filesystem (ExtensionFS)
1158
+ PRINT INFO " Creating and linking extension filesystem.."
1159
+ mkdir -p " .blueprint/extensions/$identifier /fs"
1160
+ ln -s -T $FOLDER /.blueprint/extensions/" $identifier " /fs " $FOLDER /storage/extensions/$identifier " 2>> $BLUEPRINT__DEBUG
1161
+ ln -s -T $FOLDER /storage/extensions/" $identifier " " $FOLDER /public/fs/$identifier " 2>> $BLUEPRINT__DEBUG
1162
+ if [[ $DUPLICATE == " y" ]]; then
1163
+ sed -i \
1164
+ -e " s/\/\* ${identifier^} Start \*\/.*\/\* ${identifier^} End \*\///" \
1165
+ -e " s~/\* ${identifier^} Start \*/~~g" \
1166
+ -e " s~/\* ${identifier^} End \*/~~g" \
1167
+ " config/ExtensionFS.php"
1168
+ fi
1169
+ sed -i " s~\/\* blueprint/disks \*\/~/* blueprint/disks */$CONFIGEXTENSIONFS_RESULT ~g" config/ExtensionFS.php
1170
+
1149
1171
# Create backup of generated values.
1150
- mkdir -p " .blueprint/extensions/$identifier /private/.store/build"
1151
- cp " .blueprint/extensions/blueprint/private/build/extensions/button.blade.php.bak" " .blueprint/extensions/$identifier /private/.store/build/button.blade.php"
1152
- cp " .blueprint/extensions/blueprint/private/build/extensions/route.php.bak" " .blueprint/extensions/$identifier /private/.store/build/route.php"
1172
+ mkdir -p \
1173
+ " .blueprint/extensions/$identifier /private/.store/build" \
1174
+ " .blueprint/extensions/$identifier /private/.store/build/config"
1175
+ cp " $__BuildDir /extensions/button.blade.php.bak" " .blueprint/extensions/$identifier /private/.store/build/button.blade.php"
1176
+ cp " $__BuildDir /extensions/route.php.bak" " .blueprint/extensions/$identifier /private/.store/build/route.php"
1177
+ cp " $__BuildDir /extensions/config/ExtensionFS.build.bak" " .blueprint/extensions/$identifier /private/.store/build/config/ExtensionFS.build"
1153
1178
1154
1179
# Remove temporary build files.
1155
1180
PRINT INFO " Cleaning up build files.."
1156
- if [[ $controller_type == " default" ]]; then rm " .blueprint/extensions/blueprint/private/build /extensions/controller.build.bak" ; fi
1181
+ if [[ $controller_type == " default" ]]; then rm " $__BuildDir /extensions/controller.build.bak" ; fi
1157
1182
rm \
1158
1183
" $AdminBladeConstructor " \
1159
1184
" $AdminRouteConstructor " \
1160
- " $AdminButtonConstructor "
1185
+ " $AdminButtonConstructor " \
1186
+ " $ConfigExtensionFS "
1161
1187
rm -R " .blueprint/tmp/$n "
1162
1188
1163
1189
if [[ $database_migrations != " " ]]; then
@@ -1190,12 +1216,16 @@ if [[ ( $2 == "-i" ) || ( $2 == "-install" ) || ( $2 == "-add" ) ]]; then VCMD="
1190
1216
$FOLDER /resources \
1191
1217
$FOLDER /routes \
1192
1218
$FOLDER /storage
1219
+
1220
+ # Link filesystems
1221
+ PRINT INFO " Linking filesystems.."
1222
+ php artisan storage:link & >> $BLUEPRINT__DEBUG
1193
1223
1194
1224
# Flush cache.
1195
1225
PRINT INFO " Flushing view, config and route cache.."
1196
1226
{
1197
- php artisan view:clear
1198
- php artisan config:clear
1227
+ php artisan view:cache
1228
+ php artisan config:cache
1199
1229
php artisan route:cache
1200
1230
php artisan cache:clear
1201
1231
} & >> $BLUEPRINT__DEBUG
@@ -1505,6 +1535,18 @@ if [[ ( $2 == "-r" ) || ( $2 == "-remove" ) ]]; then VCMD="y"
1505
1535
rm -R \
1506
1536
" .blueprint/extensions/$identifier /assets" \
1507
1537
" public/assets/extensions/$identifier "
1538
+
1539
+ # Remove extension filesystem (ExtensionFS)
1540
+ PRINT INFO " Removing and unlinking extension filesystem.."
1541
+ rm -r \
1542
+ " .blueprint/extensions/$identifier /fs" \
1543
+ " storage/extensions/sysautomation" \
1544
+ " storage/extensions"
1545
+ sed -i \
1546
+ -e " s/\/\* ${identifier^} Start \*\/.*\/\* ${identifier^} End \*\///" \
1547
+ -e " s~/\* ${identifier^} Start \*/~~g" \
1548
+ -e " s~/\* ${identifier^} End \*/~~g" \
1549
+ " config/ExtensionFS.php"
1508
1550
1509
1551
# Remove extension directory
1510
1552
PRINT INFO " Removing extension folder.."
@@ -1528,12 +1570,16 @@ if [[ ( $2 == "-r" ) || ( $2 == "-remove" ) ]]; then VCMD="y"
1528
1570
$FOLDER /resources \
1529
1571
$FOLDER /routes \
1530
1572
$FOLDER /storage
1573
+
1574
+ # Link filesystems
1575
+ PRINT INFO " Linking filesystems.."
1576
+ php artisan storage:link & >> $BLUEPRINT__DEBUG
1531
1577
1532
1578
# Flush cache.
1533
1579
PRINT INFO " Flushing view, config and route cache.."
1534
1580
{
1535
- php artisan view:clear
1536
- php artisan config:clear
1581
+ php artisan view:cache
1582
+ php artisan config:cache
1537
1583
php artisan route:cache
1538
1584
php artisan cache:clear
1539
1585
} & >> $BLUEPRINT__DEBUG
@@ -1694,11 +1740,11 @@ if [[ ( $2 == "-init" || $2 == "-I" ) ]]; then VCMD="y"
1694
1740
rm -R tmp/templates
1695
1741
cd ${FOLDER} || cdhalt
1696
1742
1697
- eval " $( parse_yaml .blueprint/extensions/blueprint/private/build /templates/" ${tnum} " /TemplateConfiguration.yml t_) "
1743
+ eval " $( parse_yaml $__BuildDir /templates/" ${tnum} " /TemplateConfiguration.yml t_) "
1698
1744
1699
1745
PRINT INFO " Building template.."
1700
1746
mkdir -p .blueprint/tmp/init
1701
- cp -R .blueprint/extensions/blueprint/private/build /templates/" ${tnum} " /contents/* .blueprint/tmp/init/
1747
+ cp -R $__BuildDir /templates/" ${tnum} " /contents/* .blueprint/tmp/init/
1702
1748
1703
1749
sed -i \
1704
1750
-e " s~␀name␀~${ASKNAME} ~g" \
@@ -1722,7 +1768,7 @@ if [[ ( $2 == "-init" || $2 == "-I" ) ]]; then VCMD="y"
1722
1768
PRINT INFO " Cleaning up build files.."
1723
1769
rm -R \
1724
1770
" .blueprint/tmp" \
1725
- " .blueprint/extensions/blueprint/private/build /templates/" *
1771
+ " $__BuildDir /templates/" *
1726
1772
mkdir -p .blueprint/tmp
1727
1773
1728
1774
sendTelemetry " INITIALIZE_DEVELOPMENT_EXTENSION" >> $BLUEPRINT__DEBUG
0 commit comments