{
    "name": "brainmaestro/composer-git-hooks",
    "description": "Easily manage git hooks in your composer config",
    "type": "library",
    "minimum-stability": "stable",
    "license": "MIT",
    "keywords": [
        "git",
        "hook",
        "composer"
    ],
    "authors": [
        {
            "name": "Ezinwa Okpoechi",
            "email": "brainmaestro@outlook.com"
        }
    ],
    "require": {
        "php": "^5.6 || >=7.0",
        "symfony/console": "^3.2 || ^4.0 || ^5.0"
    },
    "require-dev": {
        "phpunit/phpunit": "^5.7 || ^7.0",
        "friendsofphp/php-cs-fixer": "^2.9",
        "ext-json": "*"
    },
    "autoload": {
        "psr-4": {
            "BrainMaestro\\GitHooks\\": "src/"
        },
        "files": [
            "src/helpers.php"
        ]
    },
    "autoload-dev": {
        "psr-4": {
            "BrainMaestro\\GitHooks\\Tests\\": "tests/"
        }
    },
    "bin": [
        "cghooks"
    ],
    "scripts": {
        "test": "vendor/bin/phpunit",
        "post-install-cmd": "./cghooks add --ignore-lock",
        "post-update-cmd": "./cghooks update",
        "check-style": "php-cs-fixer fix --using-cache=no --diff --dry-run .",
        "fix-style": "php-cs-fixer fix --using-cache=no ."
    },
    "scripts-descriptions": {
        "test": "Run all tests.",
        "check-style": "Run style checks (only dry run - no fixing!).",
        "fix-style": "Run style checks and fix violations."
    },
    "extra": {
        "hooks": {
            "pre-commit": "composer check-style",
            "pre-push": [
                "composer test",
                "appver=$(grep -o -E '\\d.\\d.\\d' cghooks)",
                "tag=$(git describe --tags --abbrev=0)",
                "if [ \"$tag\" != \"v$appver\" ]; then",
                "echo \"The most recent tag $tag does not match the application version $appver\\n\"",
                "tag=${tag#v}",
                "sed -i -E \"s/$appver/$tag/\" cghooks",
                "exit 1",
                "fi"
            ]
        }
    }
}
