Skip to content

Find the differences between your .env and .env.example files using git hooks or composer scripts

License

Notifications You must be signed in to change notification settings

kielabokkie/dotenv-diff

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dotenv diff

Author Packagist Version Software License Gitter

This package automatically compares your .env an .env.example files and notifies you when there are differences.

Installation

The preferred way of installing this package is through composer:

composer require kielabokkie/dotenv-diff

Usage

Once the package is installed there are two ways of running the Dotenv diff automatically, either by using git hooks or composer scripts.

Git hooks

First of all you can have the Dotenv diff run automatically when you do a git pull. To set this up you'll need to copy over the supplied post-merge git hook to your .git/hooks folder.

From the root of your project execute the following command:

cp vendor/kielabokkie/dotenv-diff/git/hooks/post-merge .git/hooks/

Note: this will overwrite your existing post-merge hook so if you already have one you'll need to figure out how to combine multiple post merge hooks

Composer

You can also set it up so it runs whenever you run composer commands like composer install or composer update.

All you need to do is call the run method from the scripts section of your composer.json file:

{
    "scripts": {
        "post-install-cmd": [
            "Kielabokkie\\DotenvDiff::run"
        ],
        "post-update-cmd": [
            "Kielabokkie\\DotenvDiff::run"
        ]
    }
}

About

Find the differences between your .env and .env.example files using git hooks or composer scripts

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages