Merge pull request #14578 from Q4kK/features/add_no_interactive
Feat: add no-interactive flag for `upgrade.php`
This commit is contained in:
commit
f080c0cdcd
1 changed files with 11 additions and 1 deletions
12
upgrade.php
12
upgrade.php
|
@ -19,6 +19,7 @@ $app_environment = 'develop';
|
||||||
$skip_php_checks = false;
|
$skip_php_checks = false;
|
||||||
$branch = 'master';
|
$branch = 'master';
|
||||||
$branch_override = false;
|
$branch_override = false;
|
||||||
|
$no_interactive = false;
|
||||||
|
|
||||||
// Check for branch or other overrides
|
// Check for branch or other overrides
|
||||||
if ($argc > 1){
|
if ($argc > 1){
|
||||||
|
@ -32,6 +33,9 @@ if ($argc > 1){
|
||||||
$branch = $argv[$arg];
|
$branch = $argv[$arg];
|
||||||
$branch_override = true;
|
$branch_override = true;
|
||||||
break;
|
break;
|
||||||
|
case '--no-interactive':
|
||||||
|
$no_interactive = true;
|
||||||
|
break;
|
||||||
default: // for legacy support from before we started using --branch
|
default: // for legacy support from before we started using --branch
|
||||||
$branch = $argv[$arg];
|
$branch = $argv[$arg];
|
||||||
$branch_override = true;
|
$branch_override = true;
|
||||||
|
@ -81,7 +85,13 @@ if($upgrade_requirements){
|
||||||
echo "Found PHP requirements, will check for PHP > $php_min_works and < $php_max_wontwork\n";
|
echo "Found PHP requirements, will check for PHP > $php_min_works and < $php_max_wontwork\n";
|
||||||
}
|
}
|
||||||
// done fetching requirements
|
// done fetching requirements
|
||||||
$yesno = readline("\nProceed with upgrade? [Y/n]: ");
|
|
||||||
|
if (!$no_interactive) {
|
||||||
|
$yesno = readline("\nProceed with upgrade? [Y/n]: ");
|
||||||
|
} else {
|
||||||
|
$yesno = "yes";
|
||||||
|
}
|
||||||
|
|
||||||
if ($yesno == "yes" || $yesno == "YES" ||$yesno == "y" ||$yesno == "Y"){
|
if ($yesno == "yes" || $yesno == "YES" ||$yesno == "y" ||$yesno == "Y"){
|
||||||
# don't do anything
|
# don't do anything
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Reference in a new issue