Skip to content

Commit a0b2b04

Browse files
committed
sync.
2 parents 8cf24ac + 234656f commit a0b2b04

File tree

3 files changed

+37
-12
lines changed

3 files changed

+37
-12
lines changed

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,18 @@
22

33
All notable changes to `laravel-env-keys-checker` will be documented in this file.
44

5+
## v1.4.1 - 2024-10-13
6+
7+
### What's Changed
8+
9+
* Added no progress option by @fkrzski in https://github.com/msamgan/laravel-env-keys-checker/pull/14
10+
11+
### New Contributors
12+
13+
* @fkrzski made their first contribution in https://github.com/msamgan/laravel-env-keys-checker/pull/14
14+
15+
**Full Changelog**: https://github.com/msamgan/laravel-env-keys-checker/compare/v1.4.0...v1.4.1
16+
517
## v1.4.0 - 2024-10-08
618

719
### What's Changed

README.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,12 @@
22

33
![image](https://github.com/user-attachments/assets/8f80ef4a-a777-46ed-bc49-e70e3c1bec60)
44

5-
65
[![Latest Version on Packagist](https://img.shields.io/packagist/v/msamgan/laravel-env-keys-checker.svg?style=flat-square)](https://packagist.org/packages/msamgan/laravel-env-keys-checker)
76
[![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/msamgan/laravel-env-keys-checker/run-tests.yml?branch=main&label=tests&style=flat-square)](https://github.com/msamgan/laravel-env-keys-checker/actions?query=workflow%3Arun-tests+branch%3Amain)
87
[![Total Downloads](https://img.shields.io/packagist/dt/msamgan/laravel-env-keys-checker.svg?style=flat-square)](https://packagist.org/packages/msamgan/laravel-env-keys-checker)
98

10-
This package is used to check if all the keys are available across all the .env files.
11-
This package is useful when you have multiple .env files,
12-
and you want to make sure that all the keys are available across all the .env files.
9+
This package checks if all the keys are available across all the .env files. This package is useful when you have
10+
multiple .env files and want to ensure all the keys are available across all the .env files.
1311

1412
With a team of developers, it is possible that some developers might forget to add the keys they used in their .env file
1513
to the .env.example file or the other way around.
@@ -20,6 +18,7 @@ to the .env.example file or the other way around.
2018
- [Installation](#installation)
2119
- [Usage](#usage)
2220
- [To check if all the keys are available across all the .env files.](#to-check-if-all-the-keys-are-available-across-all-the-env-files)
21+
- [Options](#options)
2322
- [To check if the .env and other provided files are present in .gitignore.](#to-check-if-the-env-and-other-provided-files-are-present-in-gitignore)
2423
- [In Test](#in-test)
2524
- [To check if all the keys are available across all the .env files.](#to-check-if-all-the-keys-are-available-across-all-the-env-files-1)
@@ -65,6 +64,15 @@ php artisan vendor:publish --tag="env-keys-checker-config"
6564
php artisan env:keys-check
6665
```
6766

67+
#### Options
68+
69+
``--auto-add``: This option will add the missing keys to the .env files automatically.
70+
The possible values are ``ask``,
71+
``auto``, and ``none``.
72+
The default value is ``ask``.
73+
74+
``--no-progress``: This option will disable the progress bar.
75+
6876
### To check if the .env and other provided files are present in .gitignore.
6977

7078
```bash

src/Commands/KeysCheckerCommand.php

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ class KeysCheckerCommand extends Command
1818
{
1919
use HelperFunctions;
2020

21-
public $signature = 'env:keys-check
22-
{--auto-add= : Auto add missing keys to the .env files. Available options: ask, auto, none}';
21+
public $signature = 'env:keys-check {--auto-add=} {--no-progress}';
2322

2423
public $description = 'Check if all keys in .env file are present across all .env files. Like .env, .env.example, .env.testing, etc.';
2524

@@ -57,12 +56,18 @@ public function handle(GetKeys $getKeys, CheckKeys $checkKeys, AddKeys $addKeys)
5756

5857
$missingKeys = collect();
5958

60-
progress(
61-
label: 'Checking keys...',
62-
steps: $keys,
63-
callback: fn ($key) => $checkKeys->handle(keyData: $key, envFiles: $envFiles, missingKeys: $missingKeys),
64-
hint: 'It won\'t take long.'
65-
);
59+
$processKeys = fn ($key) => $checkKeys->handle(keyData: $key, envFiles: $envFiles, missingKeys: $missingKeys);
60+
61+
if ($this->option('no-progress')) {
62+
$keys->each($processKeys);
63+
} else {
64+
progress(
65+
label: 'Checking keys...',
66+
steps: $keys,
67+
callback: $processKeys,
68+
hint: 'It won\'t take long.'
69+
);
70+
}
6671

6772
if ($missingKeys->isEmpty()) {
6873
$this->showSuccessInfo(

0 commit comments

Comments
 (0)