laravel / pennant

A simple, lightweight library for managing feature flags.
https://laravel.com/docs/pennant
MIT License
482 stars 49 forks source link

Fixes purge output message when nothing is purged #114

Closed timacdonald closed 4 months ago

timacdonald commented 4 months ago

When using the --except flags, you can sometimes see the message "All features purged from storage" when nothing has been purged.

Imagine you have a feature defined and have that feature has been resolved and stored in the database...

Feature::define('feature-name', true);

Feature::active('feature-name');

Then when you run the command to purge everything except that feature, which means nothing is going to be purged, it outputs the wrong message.

php artisan pennant:purge --except=feature-name

- All features successfully purged from storage.
+ No features to purge from storage.