diff --git a/README.md b/README.md new file mode 100644 index 0000000000000000000000000000000000000000..1a0cd415b47ec9f6d30d5cda11650fe71a51af2e --- /dev/null +++ b/README.md @@ -0,0 +1,5 @@ +# Ahoy support for Drupal projects + +This is a composer plugin which prepares your local development environment for Ahoy using the framework from [Ahoy-CLI](https://github.com/ahoy-cli/ahoy). + +If you [installed Ahoy-CLI](https://github.com/ahoy-cli/ahoy#installation) globally once you can use it in Drupal projects without any further configuration. diff --git a/src/Handler.php b/src/Handler.php index b42bb888188cedc1cd19b28729721f56e9de7092..f86e0af13c019d9d3a0900d8c656f4d9a9aba59e 100644 --- a/src/Handler.php +++ b/src/Handler.php @@ -85,6 +85,17 @@ class Handler { } $file = getcwd() . '/.ahoy.yml'; file_put_contents($file, $rendered = Yaml::dump($ahoy, 9, 2)); + $this->git('ignore ' . '.ahoy.yml'); + } + + /** + * Wrapper for git command in the root directory. + * + * @param string $command + * Git command name, arguments and/or options. + */ + protected function git($command) { + passthru(escapeshellcmd('git -c "user.email=d8-project@lakedrops.com" ' . $command)); } }