From 01ecf3e42dba13501324b25142fbe821fcba84a0 Mon Sep 17 00:00:00 2001 From: Joe Dixon Date: Fri, 18 Nov 2022 15:11:05 +0000 Subject: [PATCH] [1.x] Renders error from the `SecretCommand` (#202) * Render error * Exits with `1`. * Apply fixes from StyleCI * Update SecretCommand.php Co-authored-by: Nuno Maduro Co-authored-by: StyleCI Bot Co-authored-by: Taylor Otwell --- src/Commands/SecretCommand.php | 27 +++------------------------ 1 file changed, 3 insertions(+), 24 deletions(-) diff --git a/src/Commands/SecretCommand.php b/src/Commands/SecretCommand.php index 5ea03325..352ac682 100644 --- a/src/Commands/SecretCommand.php +++ b/src/Commands/SecretCommand.php @@ -3,7 +3,6 @@ namespace Laravel\VaporCli\Commands; use Laravel\VaporCli\Helpers; -use Laravel\VaporCli\Manifest; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputOption; @@ -28,32 +27,12 @@ protected function configure() /** * Execute the command. * - * @return void + * @return int */ public function handle() { - Helpers::ensure_api_token_is_available(); - - $this->vapor->storeSecret( - Manifest::id(), - $this->argument('environment'), - $this->option('name') ?? Helpers::ask('Name'), - $this->option('value') ?? $this->determineValue() - ); - - Helpers::info('Secret stored successfully.'); - Helpers::line('You should deploy the project using the "deploy" command to ensure the new secrets are available.'); - } + Helpers::danger('Secrets have been deprecated. Instead, please utilize environment variables and / or encrypted environment files.'); - /** - * Determine the secret's value. - * - * @return string - */ - protected function determineValue() - { - return $this->option('file') - ? file_get_contents($this->option('file')) - : Helpers::ask('Value'); + return 1; } }