diff --git a/blueprint.sh b/blueprint.sh index 4760b6e5..5c950af6 100644 --- a/blueprint.sh +++ b/blueprint.sh @@ -228,7 +228,7 @@ if [[ $1 != "-bash" ]]; then exit 2 else # Only run if Blueprint is not in the process of upgrading. - if [[ $1 != "--post-upgrade" ]]; then + if [[ $BLUEPRINT_ENVIRONMENT != "upgrade" ]]; then # Print Blueprint icon with ascii characters. C0="\x1b[0m" C1="\x1b[31;43;1m" @@ -280,8 +280,8 @@ if [[ $1 != "-bash" ]]; then php artisan bp:cache } &>> "$BLUEPRINT__DEBUG" - # Run migrations if Blueprint is not upgrading. - if [[ ( $1 != "--post-upgrade" ) && ( $DOCKER != "y" ) ]]; then + # Run migrations if Blueprint is not running through Docker. + if [[ $DOCKER != "y" ]]; then PRINT INFO "Running database migrations.." php artisan migrate --force fi @@ -304,12 +304,12 @@ if [[ $1 != "-bash" ]]; then fi # Finish installation - if [[ $1 != "--post-upgrade" ]]; then + if [[ $BLUEPRINT_ENVIRONMENT != "upgrade" ]]; then PRINT SUCCESS "Blueprint has completed its installation process." fi - dbAdd "blueprint.setupFinished" # Let the panel know the user has finished installation. + dbAdd "blueprint.setupFinished" sed -i "s~NOTINSTALLED~INSTALLED~g" "$FOLDER/app/BlueprintFramework/Services/PlaceholderService/BlueprintPlaceholderService.php" exit 0 fi diff --git a/scripts/commands/advanced/upgrade.sh b/scripts/commands/advanced/upgrade.sh index 5ac2fc2e..d4bdd58f 100644 --- a/scripts/commands/advanced/upgrade.sh +++ b/scripts/commands/advanced/upgrade.sh @@ -106,19 +106,7 @@ Command() { -e "s|USERSHELL=\"/bin/bash\" #;|USERSHELL=\"$USERSHELL\" #;|g" \ "$FOLDER/blueprint.sh" mv "$FOLDER/blueprint" "$FOLDER/.blueprint" - bash blueprint.sh --post-upgrade - - # Ask user if they'd like to migrate their database. - PRINT INPUT "Would you like to migrate your database? (Y/n)" - read -r YN - if [[ ( $YN == "y"* ) || ( $YN == "Y"* ) || ( $YN == "" ) ]]; then - PRINT INFO "Running database migrations.." - php artisan migrate --force - php artisan up &>> "$BLUEPRINT__DEBUG" - else - PRINT INFO "Database migrations have been skipped." - fi - YN="" + BLUEPRINT_ENVIRONMENT="upgrade" bash blueprint.sh if [[ ${HAS_DEV} == true ]]; then PRINT INFO "Restoring extension development files.."