From 63ad3256ee5a661d2a34105ed69d198f585a025a Mon Sep 17 00:00:00 2001 From: johnnyq Date: Wed, 24 Jun 2026 13:18:01 -0400 Subject: [PATCH] CLI Setup: Add repo_branch option defaults to master --- scripts/setup_cli.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/setup_cli.php b/scripts/setup_cli.php index 903abd46..a6654cb7 100644 --- a/scripts/setup_cli.php +++ b/scripts/setup_cli.php @@ -40,7 +40,8 @@ $optional_args = [ 'zip' => 'Company postal code (optional)', 'phone' => 'Company phone (optional)', 'company-email' => 'Company email (optional)', - 'website' => 'Company website (optional)' + 'website' => 'Company website (optional)', + 'repo-branch' => 'Git repo branch to track (optional, default master)' ]; // Parse command line options @@ -64,6 +65,7 @@ $longopts = [ "phone::", "company-email::", "website::", + "repo-branch::", "user-name:", "user-email:", "user-password:", @@ -168,6 +170,10 @@ $password = getOptionOrPrompt('password', "Enter the database password", true); $base_url = getOptionOrPrompt('base-url', "Enter the base URL (e.g. example.com/itflow)", true); $base_url = rtrim($base_url, '/'); +// Repo Branch +$repo_branch = getOptionOrPrompt('repo-branch', "Git repo branch to track", false, 'master'); +if (empty($repo_branch)) $repo_branch = 'master'; + // Locale, Timezone, Currency echo "\n=== Localization ===\n"; $locale = getOptionOrPrompt('locale', "Enter the locale (e.g. en_US)", true); @@ -230,7 +236,7 @@ $new_config .= "\$mysqli = mysqli_connect(\$dbhost, \$dbusername, \$dbpassword, $new_config .= "\$config_app_name = 'ITFlow';\n"; $new_config .= "\$config_base_url = '" . addslashes($base_url) . "';\n"; $new_config .= "\$config_https_only = TRUE;\n"; -$new_config .= "\$repo_branch = 'master';\n"; +$new_config .= "\$repo_branch = '" . addslashes($repo_branch) . "';\n"; $new_config .= "\$installation_id = '$installation_id';\n"; if (file_put_contents("../config.php", $new_config) === false) {