diff --git a/README.md b/README.md index f5f19c4b..bd4d5482 100644 --- a/README.md +++ b/README.md @@ -51,11 +51,12 @@ Vanguard uses Duster by Tighten to ensure a consistent code style across the pro Vanguard has a few artisan commands that are specific to the project that can be run. Here is a list of the commands and what they do: -| Command | Description | -|-----------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------| -| `vanguard:generate-ssh-key` | Generates an SSH key required for backup operations. | -| `vanguard:validate-s3-connection {id}` | Able to check whether a backup destination that uses S3 can be reached. This takes the primary key of the backup destination as an id. | -| `vanguard:encrypt-database-passwords` | Used to convert any previously non-encrypted database passwords to encrypted. This was only necessary once. | +| Command | Description | +|----------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------| +| `vanguard:generate-ssh-key` | Generates an SSH key required for backup operations. | +| `vanguard:version` | Checks the version of Vanguard. | +| `vanguard:validate-s3-connection {id}` | Able to check whether a backup destination that uses S3 can be reached. This takes the primary key of the backup destination as an id. | +| `vanguard:encrypt-database-passwords` | Used to convert any previously non-encrypted database passwords to encrypted. This was only necessary once. | **Note:** There are other commands, but they are not intended to be run manually and are used internally by Vanguard's scheduler. diff --git a/VERSION b/VERSION new file mode 100644 index 00000000..6d7de6e6 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +1.0.2 diff --git a/app/Console/Commands/CheckVersion.php b/app/Console/Commands/CheckVersion.php index 7eb96651..02a7b2e8 100644 --- a/app/Console/Commands/CheckVersion.php +++ b/app/Console/Commands/CheckVersion.php @@ -2,8 +2,8 @@ namespace App\Console\Commands; +use File; use Illuminate\Console\Command; -use Illuminate\Support\Facades\File; class CheckVersion extends Command { @@ -16,8 +16,8 @@ public function handle(): void $versionFile = base_path('VERSION'); - if (! File::exists($versionFile)) { - $this->components->error('Unable to determine the current version. The version file is missing.'); + if (!File::exists($versionFile)) { + $this->components->error("Unable to determine the current version. The version file is missing."); return; } diff --git a/tests/Feature/Console/Commands/CheckVersionTest.php b/tests/Feature/Console/Commands/CheckVersionTest.php index 68453ec2..734b04fc 100644 --- a/tests/Feature/Console/Commands/CheckVersionTest.php +++ b/tests/Feature/Console/Commands/CheckVersionTest.php @@ -11,6 +11,7 @@ ->assertExitCode(0); }); + it('returns the current version number from the file', function () { File::shouldReceive('exists')->with(base_path('VERSION'))->andReturn(true); File::shouldReceive('get')->with(base_path('VERSION'))->andReturn('1.0.0');