From 7a6968a4089b63ff1f76d08df70f8d2309812d24 Mon Sep 17 00:00:00 2001
From: jurgenhaas <juergen@paragon-es.de>
Date: Tue, 30 Oct 2018 18:45:59 +0100
Subject: [PATCH] Git ignore .ahoy.yml Add readme

---
 README.md       |  5 +++++
 src/Handler.php | 11 +++++++++++
 2 files changed, 16 insertions(+)
 create mode 100644 README.md

diff --git a/README.md b/README.md
new file mode 100644
index 0000000..1a0cd41
--- /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 b42bb88..f86e0af 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));
   }
 
 }
-- 
GitLab